summaryrefslogtreecommitdiffstats
path: root/fs/9p
diff options
context:
space:
mode:
authorZhang Mingyu <zhang.mingyu@zte.com.cn>2021-11-12 09:25:47 +0000
committerDominique Martinet <asmadeus@codewreck.org>2022-01-10 10:00:09 +0900
commita7a427d1543f89ad57fda5d6b9bb70f4cecb2fba (patch)
treed87ac4dd7d5d024735d706889ccf29c901bacaff /fs/9p
parent019641d1b57dff018972b23c95e898f9ff18222f (diff)
downloadlinux-stable-a7a427d1543f89ad57fda5d6b9bb70f4cecb2fba.tar.gz
linux-stable-a7a427d1543f89ad57fda5d6b9bb70f4cecb2fba.tar.bz2
linux-stable-a7a427d1543f89ad57fda5d6b9bb70f4cecb2fba.zip
9p: Use BUG_ON instead of if condition followed by BUG.
This issue was detected with the help of Coccinelle. Link: https://lkml.kernel.org/r/20211112092547.9153-1-zhang.mingyu@zte.com.cn Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Zhang Mingyu <zhang.mingyu@zte.com.cn> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'fs/9p')
-rw-r--r--fs/9p/vfs_file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index b42b65e15b81..ed0c85a2fb89 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -138,8 +138,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
fid = filp->private_data;
BUG_ON(fid == NULL);
- if ((fl->fl_flags & FL_POSIX) != FL_POSIX)
- BUG();
+ BUG_ON((fl->fl_flags & FL_POSIX) != FL_POSIX);
res = locks_lock_file_wait(filp, fl);
if (res < 0)