[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>
This commit is contained in:
committed by
Linus Torvalds
parent
9c2153844d
commit
f5e3c2faa2
@ -528,9 +528,8 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
|
||||
|
||||
// printk("IDE Taskfile ...\n");
|
||||
|
||||
req_task = kmalloc(tasksize, GFP_KERNEL);
|
||||
req_task = kzalloc(tasksize, GFP_KERNEL);
|
||||
if (req_task == NULL) return -ENOMEM;
|
||||
memset(req_task, 0, tasksize);
|
||||
if (copy_from_user(req_task, buf, tasksize)) {
|
||||
kfree(req_task);
|
||||
return -EFAULT;
|
||||
@ -541,12 +540,11 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
|
||||
|
||||
if (taskout) {
|
||||
int outtotal = tasksize;
|
||||
outbuf = kmalloc(taskout, GFP_KERNEL);
|
||||
outbuf = kzalloc(taskout, GFP_KERNEL);
|
||||
if (outbuf == NULL) {
|
||||
err = -ENOMEM;
|
||||
goto abort;
|
||||
}
|
||||
memset(outbuf, 0, taskout);
|
||||
if (copy_from_user(outbuf, buf + outtotal, taskout)) {
|
||||
err = -EFAULT;
|
||||
goto abort;
|
||||
@ -555,12 +553,11 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
|
||||
|
||||
if (taskin) {
|
||||
int intotal = tasksize + taskout;
|
||||
inbuf = kmalloc(taskin, GFP_KERNEL);
|
||||
inbuf = kzalloc(taskin, GFP_KERNEL);
|
||||
if (inbuf == NULL) {
|
||||
err = -ENOMEM;
|
||||
goto abort;
|
||||
}
|
||||
memset(inbuf, 0, taskin);
|
||||
if (copy_from_user(inbuf, buf + intotal, taskin)) {
|
||||
err = -EFAULT;
|
||||
goto abort;
|
||||
@ -709,10 +706,9 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
|
||||
|
||||
if (args[3]) {
|
||||
argsize = 4 + (SECTOR_WORDS * 4 * args[3]);
|
||||
argbuf = kmalloc(argsize, GFP_KERNEL);
|
||||
argbuf = kzalloc(argsize, GFP_KERNEL);
|
||||
if (argbuf == NULL)
|
||||
return -ENOMEM;
|
||||
memcpy(argbuf, args, 4);
|
||||
}
|
||||
if (set_transfer(drive, &tfargs)) {
|
||||
xfer_rate = args[1];
|
||||
|
Reference in New Issue
Block a user