diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/ide-scsi.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index bb90df8bdce4..1cc01acc2808 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -328,17 +328,15 @@ static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_co | |||
328 | u8 *buf; | 328 | u8 *buf; |
329 | 329 | ||
330 | /* stuff a sense request in front of our current request */ | 330 | /* stuff a sense request in front of our current request */ |
331 | pc = kmalloc (sizeof (idescsi_pc_t), GFP_ATOMIC); | 331 | pc = kzalloc(sizeof(idescsi_pc_t), GFP_ATOMIC); |
332 | rq = kmalloc (sizeof (struct request), GFP_ATOMIC); | 332 | rq = kmalloc(sizeof(struct request), GFP_ATOMIC); |
333 | buf = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_ATOMIC); | 333 | buf = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_ATOMIC); |
334 | if (pc == NULL || rq == NULL || buf == NULL) { | 334 | if (!pc || !rq || !buf) { |
335 | kfree(buf); | 335 | kfree(buf); |
336 | kfree(rq); | 336 | kfree(rq); |
337 | kfree(pc); | 337 | kfree(pc); |
338 | return -ENOMEM; | 338 | return -ENOMEM; |
339 | } | 339 | } |
340 | memset (pc, 0, sizeof (idescsi_pc_t)); | ||
341 | memset (buf, 0, SCSI_SENSE_BUFFERSIZE); | ||
342 | ide_init_drive_cmd(rq); | 340 | ide_init_drive_cmd(rq); |
343 | rq->special = (char *) pc; | 341 | rq->special = (char *) pc; |
344 | pc->rq = rq; | 342 | pc->rq = rq; |