From: David M. Richter Date: Wed, 23 Apr 2008 20:28:59 +0000 (-0400) Subject: leases: fix a return-value mixup X-Git-Tag: v2.6.26-rc1~1074^2~8 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=5fcc60c3a05bf417229fba715e7aec52bf6717fb;p=linux-2.6-omap-h63xx.git leases: fix a return-value mixup Fixes a return-value mixup from 85c59580b30c82aa771aa33b37217a6b6851bc14 "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: David M. Richter Signed-off-by: J. Bruce Fields --- diff --git a/fs/locks.c b/fs/locks.c index 592faadbcec..b9f3a0bed30 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1404,6 +1404,7 @@ int generic_setlease(struct file *filp, long arg, struct file_lock **flp) rdlease_count++; } + error = -EAGAIN; if ((arg == F_RDLCK && (wrlease_count > 0)) || (arg == F_WRLCK && ((rdlease_count + wrlease_count) > 0))) goto out;