2010-08-19 04:05:08

by Tao Ma

[permalink] [raw]
Subject: [PATCH] trivial: Use kzalloc in idedisk_prep_fn.

Cc: Jiri Kosina <[email protected]>
Signed-off-by: Tao Ma <[email protected]>
---
drivers/ide/ide-disk.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 7433e07..471bb0d 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -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;
--
1.7.1.GIT


2010-08-19 06:58:30

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] trivial: Use kzalloc in idedisk_prep_fn.

On 08/19/2010 12:02 AM, Tao Ma wrote:
> Cc: Jiri Kosina<[email protected]>
> Signed-off-by: Tao Ma<[email protected]>

Acked-by: Jeff Garzik <[email protected]>

2010-08-19 08:55:21

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH] trivial: Use kzalloc in idedisk_prep_fn.

On Thu, 19 Aug 2010, Jeff Garzik wrote:

> > Cc: Jiri Kosina<[email protected]>
> > Signed-off-by: Tao Ma<[email protected]>
>
> Acked-by: Jeff Garzik <[email protected]>

Applied, thanks.

--
Jiri Kosina
SUSE Labs, Novell Inc.