aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2006-01-08 06:33:45 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 17:49:52 -0500
commit887c2560b6ceb5fe7ac24704e85af507c6d960e5 (patch)
treedd363a707a717bb87c1b89a64ab46b3394524a3f /drivers/usb/storage
parent9ff87d7326d9e4666721070040474f60a68ab467 (diff)
[PATCH] USB: kzalloc for storage
another one for kzalloc. This covers the storage subdirectory. Signed-off-by: Oliver Neukum <oliver@neukum.name> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r--drivers/usb/storage/datafab.c3
-rw-r--r--drivers/usb/storage/isd200.c8
-rw-r--r--drivers/usb/storage/jumpshot.c3
-rw-r--r--drivers/usb/storage/sddr55.c3
-rw-r--r--drivers/usb/storage/shuttle_usbat.c3
5 files changed, 7 insertions, 13 deletions
diff --git a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c
index 54e3e6c7ecd8..01d8971ad7db 100644
--- a/drivers/usb/storage/datafab.c
+++ b/drivers/usb/storage/datafab.c
@@ -512,13 +512,12 @@ int datafab_transport(struct scsi_cmnd * srb, struct us_data *us)
512 }; 512 };
513 513
514 if (!us->extra) { 514 if (!us->extra) {
515 us->extra = kmalloc(sizeof(struct datafab_info), GFP_NOIO); 515 us->extra = kzalloc(sizeof(struct datafab_info), GFP_NOIO);
516 if (!us->extra) { 516 if (!us->extra) {
517 US_DEBUGP("datafab_transport: Gah! " 517 US_DEBUGP("datafab_transport: Gah! "
518 "Can't allocate storage for Datafab info struct!\n"); 518 "Can't allocate storage for Datafab info struct!\n");
519 return USB_STOR_TRANSPORT_ERROR; 519 return USB_STOR_TRANSPORT_ERROR;
520 } 520 }
521 memset(us->extra, 0, sizeof(struct datafab_info));
522 us->extra_destructor = datafab_info_destructor; 521 us->extra_destructor = datafab_info_destructor;
523 ((struct datafab_info *)us->extra)->lun = -1; 522 ((struct datafab_info *)us->extra)->lun = -1;
524 } 523 }
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
index ecb328aa9ea1..7308e8cbe8f9 100644
--- a/drivers/usb/storage/isd200.c
+++ b/drivers/usb/storage/isd200.c
@@ -1361,21 +1361,19 @@ static int isd200_init_info(struct us_data *us)
1361 struct isd200_info *info; 1361 struct isd200_info *info;
1362 1362
1363 info = (struct isd200_info *) 1363 info = (struct isd200_info *)
1364 kmalloc(sizeof(struct isd200_info), GFP_KERNEL); 1364 kzalloc(sizeof(struct isd200_info), GFP_KERNEL);
1365 if (!info) 1365 if (!info)
1366 retStatus = ISD200_ERROR; 1366 retStatus = ISD200_ERROR;
1367 else { 1367 else {
1368 memset(info, 0, sizeof(struct isd200_info));
1369 info->id = (struct hd_driveid *) 1368 info->id = (struct hd_driveid *)
1370 kmalloc(sizeof(struct hd_driveid), GFP_KERNEL); 1369 kzalloc(sizeof(struct hd_driveid), GFP_KERNEL);
1371 info->RegsBuf = (unsigned char *) 1370 info->RegsBuf = (unsigned char *)
1372 kmalloc(sizeof(info->ATARegs), GFP_KERNEL); 1371 kmalloc(sizeof(info->ATARegs), GFP_KERNEL);
1373 if (!info->id || !info->RegsBuf) { 1372 if (!info->id || !info->RegsBuf) {
1374 isd200_free_info_ptrs(info); 1373 isd200_free_info_ptrs(info);
1375 kfree(info); 1374 kfree(info);
1376 retStatus = ISD200_ERROR; 1375 retStatus = ISD200_ERROR;
1377 } else 1376 }
1378 memset(info->id, 0, sizeof(struct hd_driveid));
1379 } 1377 }
1380 1378
1381 if (retStatus == ISD200_GOOD) { 1379 if (retStatus == ISD200_GOOD) {
diff --git a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c
index aff9d51c327c..5031aa98f6a9 100644
--- a/drivers/usb/storage/jumpshot.c
+++ b/drivers/usb/storage/jumpshot.c
@@ -441,12 +441,11 @@ int jumpshot_transport(struct scsi_cmnd * srb, struct us_data *us)
441 }; 441 };
442 442
443 if (!us->extra) { 443 if (!us->extra) {
444 us->extra = kmalloc(sizeof(struct jumpshot_info), GFP_NOIO); 444 us->extra = kzalloc(sizeof(struct jumpshot_info), GFP_NOIO);
445 if (!us->extra) { 445 if (!us->extra) {
446 US_DEBUGP("jumpshot_transport: Gah! Can't allocate storage for jumpshot info struct!\n"); 446 US_DEBUGP("jumpshot_transport: Gah! Can't allocate storage for jumpshot info struct!\n");
447 return USB_STOR_TRANSPORT_ERROR; 447 return USB_STOR_TRANSPORT_ERROR;
448 } 448 }
449 memset(us->extra, 0, sizeof(struct jumpshot_info));
450 us->extra_destructor = jumpshot_info_destructor; 449 us->extra_destructor = jumpshot_info_destructor;
451 } 450 }
452 451
diff --git a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c
index 8451779f4269..0b1b5b59ca7b 100644
--- a/drivers/usb/storage/sddr55.c
+++ b/drivers/usb/storage/sddr55.c
@@ -751,11 +751,10 @@ int sddr55_transport(struct scsi_cmnd *srb, struct us_data *us)
751 struct sddr55_card_info *info; 751 struct sddr55_card_info *info;
752 752
753 if (!us->extra) { 753 if (!us->extra) {
754 us->extra = kmalloc( 754 us->extra = kzalloc(
755 sizeof(struct sddr55_card_info), GFP_NOIO); 755 sizeof(struct sddr55_card_info), GFP_NOIO);
756 if (!us->extra) 756 if (!us->extra)
757 return USB_STOR_TRANSPORT_ERROR; 757 return USB_STOR_TRANSPORT_ERROR;
758 memset(us->extra, 0, sizeof(struct sddr55_card_info));
759 us->extra_destructor = sddr55_card_info_destructor; 758 us->extra_destructor = sddr55_card_info_destructor;
760 } 759 }
761 760
diff --git a/drivers/usb/storage/shuttle_usbat.c b/drivers/usb/storage/shuttle_usbat.c
index fea176d7e79a..f2bc5c9e23d5 100644
--- a/drivers/usb/storage/shuttle_usbat.c
+++ b/drivers/usb/storage/shuttle_usbat.c
@@ -1318,12 +1318,11 @@ int init_usbat(struct us_data *us)
1318 unsigned char subcountL = USBAT_ATA_LBA_ME; 1318 unsigned char subcountL = USBAT_ATA_LBA_ME;
1319 unsigned char *status = us->iobuf; 1319 unsigned char *status = us->iobuf;
1320 1320
1321 us->extra = kmalloc(sizeof(struct usbat_info), GFP_NOIO); 1321 us->extra = kzalloc(sizeof(struct usbat_info), GFP_NOIO);
1322 if (!us->extra) { 1322 if (!us->extra) {
1323 US_DEBUGP("init_usbat: Gah! Can't allocate storage for usbat info struct!\n"); 1323 US_DEBUGP("init_usbat: Gah! Can't allocate storage for usbat info struct!\n");
1324 return 1; 1324 return 1;
1325 } 1325 }
1326 memset(us->extra, 0, sizeof(struct usbat_info));
1327 info = (struct usbat_info *) (us->extra); 1326 info = (struct usbat_info *) (us->extra);
1328 1327
1329 /* Enable peripheral control signals */ 1328 /* Enable peripheral control signals */