User: | Jiri Slaby |
Error type: | Invalid Pointer Dereference |
Error type description: | A pointer which is invalid is being dereferenced |
File location: | drivers/message/fusion/mptscsih.c |
Line in file: | 1227 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Smatch
(1.59)
|
Entered: | 2013-09-11 08:47:26 UTC |
1197 1198#endif 1199 1200/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1201/** 1202 * mptscsih_info - Return information about MPT adapter 1203 * @SChost: Pointer to Scsi_Host structure 1204 * 1205 * (linux scsi_host_template.info routine) 1206 * 1207 * Returns pointer to buffer where information was written. 1208 */ 1209const char * 1210mptscsih_info(struct Scsi_Host *SChost) 1211{ 1212 MPT_SCSI_HOST *h; 1213 int size = 0; 1214 1215 h = shost_priv(SChost); 1216 1217 if (h) { 1218 if (h->info_kbuf == NULL) 1219 if ((h->info_kbuf = kmalloc(0x1000 /* 4Kb */, GFP_KERNEL)) == NULL) 1220 return h->info_kbuf; 1221 h->info_kbuf[0] = '\0'; 1222 1223 mpt_print_ioc_summary(h->ioc, h->info_kbuf, &size, 0, 0); 1224 h->info_kbuf[size-1] = '\0'; 1225 } 1226 1227 return h->info_kbuf; 1228} 1229 1230struct info_str { 1231 char *buffer; 1232 int length; 1233 int offset; 1234 int pos; 1235}; 1236 1237static void