From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: [patch v2] locks: missing unlock on error in generic_add_lease() Date: Wed, 13 Nov 2013 17:10:31 +0300 Message-ID: <20131113141031.GA29645@elgon.mountain> References: <20131113135103.GA27536@pad.fieldses.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alexander Viro , linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org To: Matthew Wilcox , "J. Bruce Fields" Return-path: Received: from aserp1040.oracle.com ([141.146.126.69]:25342 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755556Ab3KMOKq (ORCPT ); Wed, 13 Nov 2013 09:10:46 -0500 Content-Disposition: inline In-Reply-To: <20131113135103.GA27536@pad.fieldses.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: We should unlock here before returning. Fixes: df4e8d2c1d2b ('locks: implement delegations') Acked-by: J. Bruce Fields Signed-off-by: Dan Carpenter --- v2: Style fix diff --git a/fs/locks.c b/fs/locks.c index f99d52b..7b7ed7d 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1495,7 +1495,8 @@ static int generic_add_lease(struct file *filp, long arg, struct file_lock **flp if (is_deleg && arg == F_WRLCK) { /* Write delegations are not currently supported: */ WARN_ON_ONCE(1); - return -EINVAL; + error = -EINVAL; + goto out; } error = -EAGAIN;