Commit 1661f2e2 authored by Vlastimil Babka's avatar Vlastimil Babka Committed by Jens Axboe

floppy: replace wrong kmalloc(GFP_USER) with GFP_KERNEL

The raw_cmd_copyin() function does a kmalloc() with GFP_USER, although the
allocated structure is obviously not mapped to userspace, just copied from/to.
In this case GFP_KERNEL is more appropriate, so let's use it, although in the
current implementation this does not manifest as any error.
Reported-by: default avatarMatthew Wilcox <mawilcox@linuxonhyperv.com>
Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent a121103c
...@@ -3119,7 +3119,7 @@ static int raw_cmd_copyin(int cmd, void __user *param, ...@@ -3119,7 +3119,7 @@ static int raw_cmd_copyin(int cmd, void __user *param,
*rcmd = NULL; *rcmd = NULL;
loop: loop:
ptr = kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER); ptr = kmalloc(sizeof(struct floppy_raw_cmd), GFP_KERNEL);
if (!ptr) if (!ptr)
return -ENOMEM; return -ENOMEM;
*rcmd = ptr; *rcmd = ptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment