Commit 41ead3c9 authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by Bartlomiej Zolnierkiewicz

drivers/scsi/ide-scsi.c: kmalloc + memset conversion to kzalloc

 drivers/scsi/ide-scsi.c | 34642 -> 34536 (-106 bytes)
 drivers/scsi/ide-scsi.o | 171728 -> 171524 (-204 bytes)
Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent cc60d8ba
...@@ -328,17 +328,15 @@ static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_co ...@@ -328,17 +328,15 @@ static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_co
u8 *buf; u8 *buf;
/* stuff a sense request in front of our current request */ /* stuff a sense request in front of our current request */
pc = kmalloc (sizeof (idescsi_pc_t), GFP_ATOMIC); pc = kzalloc(sizeof(idescsi_pc_t), GFP_ATOMIC);
rq = kmalloc (sizeof (struct request), GFP_ATOMIC); rq = kmalloc(sizeof(struct request), GFP_ATOMIC);
buf = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_ATOMIC); buf = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_ATOMIC);
if (pc == NULL || rq == NULL || buf == NULL) { if (!pc || !rq || !buf) {
kfree(buf); kfree(buf);
kfree(rq); kfree(rq);
kfree(pc); kfree(pc);
return -ENOMEM; return -ENOMEM;
} }
memset (pc, 0, sizeof (idescsi_pc_t));
memset (buf, 0, SCSI_SENSE_BUFFERSIZE);
ide_init_drive_cmd(rq); ide_init_drive_cmd(rq);
rq->special = (char *) pc; rq->special = (char *) pc;
pc->rq = rq; pc->rq = rq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment