From patchwork Mon Jul 19 13:58:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 112676 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6JDwxD4015159 for ; Mon, 19 Jul 2010 13:58:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933414Ab0GSN65 (ORCPT ); Mon, 19 Jul 2010 09:58:57 -0400 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:59871 "EHLO e28smtp06.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933239Ab0GSN64 (ORCPT ); Mon, 19 Jul 2010 09:58:56 -0400 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by e28smtp06.in.ibm.com (8.14.4/8.13.1) with ESMTP id o6JDwqtq025768 for ; Mon, 19 Jul 2010 19:28:52 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o6JDwqav3547162 for ; Mon, 19 Jul 2010 19:28:52 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o6JDwpQn004348 for ; Mon, 19 Jul 2010 19:28:51 +0530 Received: from skywalker.in.ibm.com ([9.124.213.127]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o6JDwmNL004299; Mon, 19 Jul 2010 19:28:49 +0530 From: "Aneesh Kumar K.V" To: chris.mason@oracle.com Cc: linux-btrfs@vger.kernel.org, "Aneesh Kumar K.V" Subject: [PATCH] btrfs: Fix a memleak on failed posix acl conversion Date: Mon, 19 Jul 2010 19:28:44 +0530 Message-Id: <1279547924-25141-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.2.rc3.43.g24e7a Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 19 Jul 2010 13:58:59 +0000 (UTC) diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 2222d16..6d1410e 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c @@ -60,8 +60,10 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type) size = __btrfs_getxattr(inode, name, value, size); if (size > 0) { acl = posix_acl_from_xattr(value, size); - if (IS_ERR(acl)) + if (IS_ERR(acl)) { + kfree(value); return acl; + } set_cached_acl(inode, type, acl); } kfree(value);