Skip to content

Commit

Permalink
9p: Use BUG_ON instead of if condition followed by BUG.
Browse files Browse the repository at this point in the history
This issue was detected with the help of Coccinelle.

Link: https://lkml.kernel.org/r/[email protected]
Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Zhang Mingyu <[email protected]>
Signed-off-by: Dominique Martinet <[email protected]>
  • Loading branch information
Zhang Mingyu authored and martinetd committed Jan 10, 2022
1 parent 019641d commit a7a427d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/9p/vfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a7a427d

Please sign in to comment.