util.c: degrade (valid & KDBUS_FLAG_KERNEL) to warning
authorDaniel Mack <daniel@zonque.org>
Mon, 20 Oct 2014 13:29:28 +0000 (15:29 +0200)
committerDaniel Mack <daniel@zonque.org>
Mon, 20 Oct 2014 13:30:06 +0000 (15:30 +0200)
Don't BUG_ON(valid & KDBUS_FLAG_KERNEL), a warning is sufficient.

Signed-off-by: Daniel Mack <daniel@zonque.org>
util.c

diff --git a/util.c b/util.c
index 344598b6b23fd18bc90769c91ae45b6264e87521..56846ad23e4e567a0408f84b001e384f6f1ca626 100644 (file)
--- a/util.c
+++ b/util.c
@@ -70,10 +70,10 @@ int kdbus_negotiate_flags(u64 flags, void __user *buf, off_t offset, u64 valid)
        u64 val = valid | KDBUS_FLAG_KERNEL;
 
        /*
-        * KDBUS_FLAG_KERNEL is reserved. Make sure it is never considered
+        * KDBUS_FLAG_KERNEL is reserved and will never be considered
         * valid by any user of this function.
         */
-       BUG_ON(valid & KDBUS_FLAG_KERNEL);
+       WARN_ON_ONCE(valid & KDBUS_FLAG_KERNEL);
 
        if (copy_to_user(((u8 __user *) buf) + offset, &val, sizeof(val)))
                return -EFAULT;