init: mark __user address space on string literals
When calling syscall service routines in kernel, some of arguments should be user pointers but were missing __user markup on string literals. Add it. Removes some sparse warnings. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: Phillip Lougher <phillip@lougher.demon.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
f0cfec1118
commit
562f5e638d
@@ -528,7 +528,7 @@ static void __init clean_rootfs(void)
|
||||
struct linux_dirent64 *dirp;
|
||||
int num;
|
||||
|
||||
fd = sys_open("/", O_RDONLY, 0);
|
||||
fd = sys_open((const char __user __force *) "/", O_RDONLY, 0);
|
||||
WARN_ON(fd < 0);
|
||||
if (fd < 0)
|
||||
return;
|
||||
@@ -590,7 +590,8 @@ static int __init populate_rootfs(void)
|
||||
}
|
||||
printk(KERN_INFO "rootfs image is not initramfs (%s)"
|
||||
"; looks like an initrd\n", err);
|
||||
fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 0700);
|
||||
fd = sys_open((const char __user __force *) "/initrd.image",
|
||||
O_WRONLY|O_CREAT, 0700);
|
||||
if (fd >= 0) {
|
||||
sys_write(fd, (char *)initrd_start,
|
||||
initrd_end - initrd_start);
|
||||
|
||||
Reference in New Issue
Block a user