Patchwork ide: Use kzalloc in idedisk_prepare_flush.

login
register
mail settings
Submitter Tao Ma
Date Aug. 2, 2010, 9:22 a.m.
Message ID <1280740951-13487-1-git-send-email-tao.ma@oracle.com>
Download mbox | patch
Permalink /patch/60523/
State Rejected
Delegated to: David Miller
Headers show

Comments

Tao Ma - Aug. 2, 2010, 9:22 a.m.
Signed-off-by: Tao Ma <tao.ma@oracle.com>
---
 drivers/ide/ide-disk.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
FUJITA Tomonori - Aug. 2, 2010, 4:10 p.m.
On Mon,  2 Aug 2010 17:22:31 +0800
Tao Ma <tao.ma@oracle.com> wrote:

> Signed-off-by: Tao Ma <tao.ma@oracle.com>
> ---
>  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 33d6503..127a5a2 100644
> --- a/drivers/ide/ide-disk.c
> +++ b/drivers/ide/ide-disk.c
> @@ -430,12 +430,11 @@ static void ide_disk_unlock_native_capacity(ide_drive_t *drive)
>  static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
>  {
>  	ide_drive_t *drive = q->queuedata;
> -	struct ide_cmd *cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC);
> +	struct ide_cmd *cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC);
>  
>  	/* FIXME: map struct ide_taskfile on rq->cmd[] */
>  	BUG_ON(cmd == NULL);
>  
> -	memset(cmd, 0, sizeof(*cmd));

This change conflicts with the change in linux-next (came from Jens'
tree).
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 33d6503..127a5a2 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -430,12 +430,11 @@  static void ide_disk_unlock_native_capacity(ide_drive_t *drive)
 static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
 {
 	ide_drive_t *drive = q->queuedata;
-	struct ide_cmd *cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC);
+	struct ide_cmd *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;