From patchwork Mon Nov 22 12:40:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wengang Wang X-Patchwork-Id: 347421 X-Patchwork-Delegate: Trond.Myklebust@netapp.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAMCi4F8017923 for ; Mon, 22 Nov 2010 12:44:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755681Ab0KVMoB (ORCPT ); Mon, 22 Nov 2010 07:44:01 -0500 Received: from rcsinet10.oracle.com ([148.87.113.121]:48868 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755612Ab0KVMoA (ORCPT ); Mon, 22 Nov 2010 07:44:00 -0500 Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id oAMChxdw000433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 22 Nov 2010 12:44:00 GMT Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id oAM931FO003822 for ; Mon, 22 Nov 2010 12:43:58 GMT Message-Id: <201011221243.oAM931FO003822@rcsinet13.oracle.com> Received: from abhmt004.oracle.com by acsmt353.oracle.com with ESMTP id 796393011290429756; Mon, 22 Nov 2010 04:42:36 -0800 Received: from wenwang.oracle.com (/10.191.4.132) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 22 Nov 2010 04:42:34 -0800 Received: by wenwang.oracle.com (sSMTP sendmail emulation); Mon, 22 Nov 2010 20:40:42 +0800 Date: Mon, 22 Nov 2010 20:40:42 +0800 From: Wengang Wang Subject: [PATCH] lockd: release memory for non-normal situation To: linux-nfs@vger.kernel.org Cc: greg.marsden@oracle.com, joe.jin@oracle.com Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 22 Nov 2010 12:44:04 +0000 (UTC) diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 332c54c..ec9f0f5 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c @@ -173,8 +173,10 @@ int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl) status = nlmclnt_unlock(call, fl); } else if (IS_GETLK(cmd)) status = nlmclnt_test(call, fl); - else + else { + nlm_release_call(call); status = -EINVAL; + } fl->fl_ops->fl_release_private(fl); fl->fl_ops = NULL;