Browse Source

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: Matthew Wilcox <mawilcox@linuxonhyperv.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Vlastimil Babka 8 years ago
parent
commit
1661f2e21c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/block/floppy.c

+ 1 - 1
drivers/block/floppy.c

@@ -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;