From: Vlastimil Babka Date: Wed, 4 Jan 2017 10:19:31 +0000 (+0100) Subject: floppy: replace wrong kmalloc(GFP_USER) with GFP_KERNEL X-Git-Tag: android-x86-8.1-r1~4114^2~1^2~81 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1661f2e21c8bbf922dcb76faf2126a33ffe4cddb;p=android-x86%2Fkernel.git 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 Signed-off-by: Vlastimil Babka Signed-off-by: Jiri Kosina --- diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index a391a3cfb3fe..184887af4b9f 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -3119,7 +3119,7 @@ static int raw_cmd_copyin(int cmd, void __user *param, *rcmd = NULL; loop: - ptr = kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER); + ptr = kmalloc(sizeof(struct floppy_raw_cmd), GFP_KERNEL); if (!ptr) return -ENOMEM; *rcmd = ptr;