diff options
author | Deepak Saxena <dsaxena@plexity.net> | 2005-11-07 04:01:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:54:00 -0500 |
commit | f5e3c2faa20615e900ab26bd957f898400435924 (patch) | |
tree | d3dd4c93539f155e3fd4ef18ae9cfe482ed1b340 /drivers/ide/ide-taskfile.c | |
parent | 9c2153844d72ac92b6da0ee42f7f81fb0aa91f8a (diff) |
[PATCH] ide: kmalloc + memset -> kzalloc conversion
Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r-- | drivers/ide/ide-taskfile.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index ace8edad6e96..9c3b4f615621 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -528,9 +528,8 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) | |||
528 | 528 | ||
529 | // printk("IDE Taskfile ...\n"); | 529 | // printk("IDE Taskfile ...\n"); |
530 | 530 | ||
531 | req_task = kmalloc(tasksize, GFP_KERNEL); | 531 | req_task = kzalloc(tasksize, GFP_KERNEL); |
532 | if (req_task == NULL) return -ENOMEM; | 532 | if (req_task == NULL) return -ENOMEM; |
533 | memset(req_task, 0, tasksize); | ||
534 | if (copy_from_user(req_task, buf, tasksize)) { | 533 | if (copy_from_user(req_task, buf, tasksize)) { |
535 | kfree(req_task); | 534 | kfree(req_task); |
536 | return -EFAULT; | 535 | return -EFAULT; |
@@ -541,12 +540,11 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) | |||
541 | 540 | ||
542 | if (taskout) { | 541 | if (taskout) { |
543 | int outtotal = tasksize; | 542 | int outtotal = tasksize; |
544 | outbuf = kmalloc(taskout, GFP_KERNEL); | 543 | outbuf = kzalloc(taskout, GFP_KERNEL); |
545 | if (outbuf == NULL) { | 544 | if (outbuf == NULL) { |
546 | err = -ENOMEM; | 545 | err = -ENOMEM; |
547 | goto abort; | 546 | goto abort; |
548 | } | 547 | } |
549 | memset(outbuf, 0, taskout); | ||
550 | if (copy_from_user(outbuf, buf + outtotal, taskout)) { | 548 | if (copy_from_user(outbuf, buf + outtotal, taskout)) { |
551 | err = -EFAULT; | 549 | err = -EFAULT; |
552 | goto abort; | 550 | goto abort; |
@@ -555,12 +553,11 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) | |||
555 | 553 | ||
556 | if (taskin) { | 554 | if (taskin) { |
557 | int intotal = tasksize + taskout; | 555 | int intotal = tasksize + taskout; |
558 | inbuf = kmalloc(taskin, GFP_KERNEL); | 556 | inbuf = kzalloc(taskin, GFP_KERNEL); |
559 | if (inbuf == NULL) { | 557 | if (inbuf == NULL) { |
560 | err = -ENOMEM; | 558 | err = -ENOMEM; |
561 | goto abort; | 559 | goto abort; |
562 | } | 560 | } |
563 | memset(inbuf, 0, taskin); | ||
564 | if (copy_from_user(inbuf, buf + intotal, taskin)) { | 561 | if (copy_from_user(inbuf, buf + intotal, taskin)) { |
565 | err = -EFAULT; | 562 | err = -EFAULT; |
566 | goto abort; | 563 | goto abort; |
@@ -709,10 +706,9 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) | |||
709 | 706 | ||
710 | if (args[3]) { | 707 | if (args[3]) { |
711 | argsize = 4 + (SECTOR_WORDS * 4 * args[3]); | 708 | argsize = 4 + (SECTOR_WORDS * 4 * args[3]); |
712 | argbuf = kmalloc(argsize, GFP_KERNEL); | 709 | argbuf = kzalloc(argsize, GFP_KERNEL); |
713 | if (argbuf == NULL) | 710 | if (argbuf == NULL) |
714 | return -ENOMEM; | 711 | return -ENOMEM; |
715 | memcpy(argbuf, args, 4); | ||
716 | } | 712 | } |
717 | if (set_transfer(drive, &tfargs)) { | 713 | if (set_transfer(drive, &tfargs)) { |
718 | xfer_rate = args[1]; | 714 | xfer_rate = args[1]; |