Explorar o código

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 <bfields@citi.umich.edu>
J. Bruce Fields %!s(int64=18) %!d(string=hai) anos
pai
achega
d2ab0b0c4c
Modificáronse 1 ficheiros con 1 adicións e 3 borrados
  1. 1 3
      fs/locks.c

+ 1 - 3
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;