aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 5acb83ca5ae5..74863da1d630 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -205,12 +205,11 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
205 int display_failure_msg = 1, ret; 205 int display_failure_msg = 1, ret;
206 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 206 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
207 207
208 sdev = kmalloc(sizeof(*sdev) + shost->transportt->device_size, 208 sdev = kzalloc(sizeof(*sdev) + shost->transportt->device_size,
209 GFP_ATOMIC); 209 GFP_ATOMIC);
210 if (!sdev) 210 if (!sdev)
211 goto out; 211 goto out;
212 212
213 memset(sdev, 0, sizeof(*sdev));
214 sdev->vendor = scsi_null_device_strs; 213 sdev->vendor = scsi_null_device_strs;
215 sdev->model = scsi_null_device_strs; 214 sdev->model = scsi_null_device_strs;
216 sdev->rev = scsi_null_device_strs; 215 sdev->rev = scsi_null_device_strs;
@@ -334,12 +333,11 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
334 struct scsi_target *starget; 333 struct scsi_target *starget;
335 struct scsi_target *found_target; 334 struct scsi_target *found_target;
336 335
337 starget = kmalloc(size, GFP_KERNEL); 336 starget = kzalloc(size, GFP_KERNEL);
338 if (!starget) { 337 if (!starget) {
339 printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); 338 printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__);
340 return NULL; 339 return NULL;
341 } 340 }
342 memset(starget, 0, size);
343 dev = &starget->dev; 341 dev = &starget->dev;
344 device_initialize(dev); 342 device_initialize(dev);
345 starget->reap_ref = 1; 343 starget->reap_ref = 1;