From patchwork Fri Dec 24 22:45:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Juhl X-Patchwork-Id: 432481 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 oBOMtuYt009146 for ; Fri, 24 Dec 2010 22:55:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752974Ab0LXWzN (ORCPT ); Fri, 24 Dec 2010 17:55:13 -0500 Received: from swampdragon.chaosbits.net ([90.184.90.115]:22757 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752736Ab0LXWzM (ORCPT ); Fri, 24 Dec 2010 17:55:12 -0500 Received: by swampdragon.chaosbits.net (Postfix, from userid 1000) id 0BB3F9403D; Fri, 24 Dec 2010 23:45:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by swampdragon.chaosbits.net (Postfix) with ESMTP id 052989403B; Fri, 24 Dec 2010 23:45:22 +0100 (CET) Date: Fri, 24 Dec 2010 23:45:21 +0100 (CET) From: Jesper Juhl To: linux-btrfs@vger.kernel.org cc: Chris Mason , linux-kernel@vger.kernel.org Subject: [PATCH] BTRFS: Don't leak memory 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.3 (demeter1.kernel.org [140.211.167.41]); Fri, 24 Dec 2010 22:56:10 +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);