Skip to content

Commit a7a427d

Browse files
Zhang Mingyumartinetd
authored andcommitted
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>
1 parent 019641d commit a7a427d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

fs/9p/vfs_file.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
138138
fid = filp->private_data;
139139
BUG_ON(fid == NULL);
140140

141-
if ((fl->fl_flags & FL_POSIX) != FL_POSIX)
142-
BUG();
141+
BUG_ON((fl->fl_flags & FL_POSIX) != FL_POSIX);
143142

144143
res = locks_lock_file_wait(filp, fl);
145144
if (res < 0)

0 commit comments

Comments
 (0)