From patchwork Wed Dec 15 21:57:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mariusz Kozlowski X-Patchwork-Id: 414701 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 oBFLwIfp019338 for ; Wed, 15 Dec 2010 21:58:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753973Ab0LOV5w (ORCPT ); Wed, 15 Dec 2010 16:57:52 -0500 Received: from unix.wroclaw.pl ([94.23.28.62]:38441 "EHLO unix.wroclaw.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753828Ab0LOV5v (ORCPT ); Wed, 15 Dec 2010 16:57:51 -0500 Received: from dynamic-78-8-87-232.ssp.dialog.net.pl ([78.8.87.232]:48104 helo=localhost.localdomain) by unix.wroclaw.pl with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PSzM5-0003Ua-TO; Wed, 15 Dec 2010 22:57:50 +0100 From: Mariusz Kozlowski To: Chris Mason Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Mariusz Kozlowski Subject: [PATCH] btrfs: fix memory leak on error path in btrfs_get_acl() Date: Wed, 15 Dec 2010 22:57:36 +0100 Message-Id: <1292450256-4544-1-git-send-email-mk@lab.zgora.pl> X-Mailer: git-send-email 1.7.0.4 X-SA-Report: SpamAssassin 3.2.5 (2008-06-10) on unix.wroclaw.pl Spam=No score=-1.4 bayes=0.5 autolearn=disabled Spam Tests: * -1.4 ALL_TRUSTED Passed through trusted hosts only via SMTP 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]); Wed, 15 Dec 2010 21:58:18 +0000 (UTC) diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 2222d16..11c9561 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c @@ -61,6 +61,7 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type) if (size > 0) { acl = posix_acl_from_xattr(value, size); if (IS_ERR(acl)) + kfree(value); return acl; set_cached_acl(inode, type, acl); }