Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fcc60c3 authored by David M. Richter's avatar David M. Richter Committed by J. Bruce Fields
Browse files

leases: fix a return-value mixup



Fixes a return-value mixup from 85c59580
"locks: Fix potential OOPS in generic_setlease()", in which -ENOMEM replaced
what had been intended to stay -EAGAIN in the variable "error".

Signed-off-by: default avatarDavid M. Richter <richterd@citi.umich.edu>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent b69d3987
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1404,6 +1404,7 @@ int generic_setlease(struct file *filp, long arg, struct file_lock **flp)
			rdlease_count++;
			rdlease_count++;
	}
	}


	error = -EAGAIN;
	if ((arg == F_RDLCK && (wrlease_count > 0)) ||
	if ((arg == F_RDLCK && (wrlease_count > 0)) ||
	    (arg == F_WRLCK && ((rdlease_count + wrlease_count) > 0)))
	    (arg == F_WRLCK && ((rdlease_count + wrlease_count) > 0)))
		goto out;
		goto out;