From: J. Bruce Fields Date: Sat, 30 Jun 2007 16:40:32 +0000 (-0400) Subject: locks: convert an -EINVAL return to a BUG X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d2ab0b0c4c2570921a9ec1eff1e3a5143e05b231;p=openwrt%2Fstaging%2Fblogic.git locks: convert an -EINVAL return to a BUG There's no point trying to return an error in these cases, which all represent bugs in the callers. Signed-off-by: J. Bruce Fields --- diff --git a/fs/locks.c b/fs/locks.c index 924e4a7fb1d5..3c23fd261022 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1348,9 +1348,7 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp) time_out_leases(inode); - error = -EINVAL; - if (!flp || !(*flp) || !(*flp)->fl_lmops || !(*flp)->fl_lmops->fl_break) - goto out; + BUG_ON(!(*flp)->fl_lmops->fl_break); lease = *flp;