]> Pileus Git - ~andy/linux/blobdiff - mm/swapfile.c
ARM: OMAP: clock: fix race in disable all clocks
[~andy/linux] / mm / swapfile.c
index dae42f380d6ebcde88d3aaef6aa3cb1d64e0f5a3..fafc26d1b1dc885d2541eda3bdc5705a4fe56012 100644 (file)
@@ -2022,6 +2022,9 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
        struct page *page = NULL;
        struct inode *inode = NULL;
 
+       if (swap_flags & ~SWAP_FLAGS_VALID)
+               return -EINVAL;
+
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;