CC: [email protected]
CC: [email protected]
TO: Miklos Szeredi <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

fs/overlayfs/util.c:466:2-5: WARNING: Use BUG_ON instead of if condition 
followed by BUG.
Please make sure the condition has no side effects (see conditional BUG_ON 
definition in include/asm-generic/bug.h)

 Use BUG_ON instead of a if condition followed by BUG.

Semantic patch information:
 This makes an effort to find cases where BUG() follows an if
 condition on an expression and replaces the if condition and BUG()
 with a BUG_ON having the conditional expression of the if statement
 as argument.

Generated by: scripts/coccinelle/misc/bugon.cocci

Fixes: 56230d956739 ("ovl: verify permissions in ovl_path_open()")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   0477e92881850d44910a7e94fc2c46f96faa131f
commit: 56230d956739b9cb1cbde439d76227d77979a04d ovl: verify permissions in 
ovl_path_open()
:::::: branch date: 22 hours ago
:::::: commit date: 6 months ago

Please take the patch only if it's a positive warning. Thanks!

 util.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -462,8 +462,7 @@ struct file *ovl_path_open(struct path *
        struct inode *inode = d_inode(path->dentry);
        int err, acc_mode;
 
-       if (flags & ~(O_ACCMODE | O_LARGEFILE))
-               BUG();
+       BUG_ON(flags & ~(O_ACCMODE | O_LARGEFILE));
 
        switch (flags & O_ACCMODE) {
        case O_RDONLY:
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to