Use kzalloc in idedisk_prep_fn.
authorTao Ma <tao.ma@oracle.com>
Thu, 19 Aug 2010 04:02:21 +0000 (12:02 +0800)
committerJiri Kosina <jkosina@suse.cz>
Thu, 19 Aug 2010 08:54:55 +0000 (10:54 +0200)
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/ide/ide-disk.c

index 7433e07..471bb0d 100644 (file)
@@ -435,12 +435,11 @@ static int idedisk_prep_fn(struct request_queue *q, struct request *rq)
        if (!(rq->cmd_flags & REQ_FLUSH))
                return BLKPREP_OK;
 
-       cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC);
+       cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC);
 
        /* FIXME: map struct ide_taskfile on rq->cmd[] */
        BUG_ON(cmd == NULL);
 
-       memset(cmd, 0, sizeof(*cmd));
        if (ata_id_flush_ext_enabled(drive->id) &&
            (drive->capacity64 >= (1UL << 28)))
                cmd->tf.command = ATA_CMD_FLUSH_EXT;