From patchwork Thu Jan 6 21:45:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Juhl X-Patchwork-Id: 460871 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 p06LjLRi018306 for ; Thu, 6 Jan 2011 21:45:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752232Ab1AFVpW (ORCPT ); Thu, 6 Jan 2011 16:45:22 -0500 Received: from swampdragon.chaosbits.net ([90.184.90.115]:17611 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751523Ab1AFVpW (ORCPT ); Thu, 6 Jan 2011 16:45:22 -0500 Received: by swampdragon.chaosbits.net (Postfix, from userid 1000) id 306C99403D; Thu, 6 Jan 2011 22:45:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by swampdragon.chaosbits.net (Postfix) with ESMTP id 29CBE9403B; Thu, 6 Jan 2011 22:45:21 +0100 (CET) Date: Thu, 6 Jan 2011 22:45:21 +0100 (CET) From: Jesper Juhl To: linux-btrfs@vger.kernel.org cc: linux-kernel@vger.kernel.org, Chris Mason Subject: [PATCH] btrfs: Mem leak in btrfs_get_acl() Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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.6 (demeter1.kernel.org [140.211.167.41]); Thu, 06 Jan 2011 21:45:28 +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);