From patchwork Sun Apr 3 12:31:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshinori Sano X-Patchwork-Id: 684101 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 p33CYDjw004970 for ; Sun, 3 Apr 2011 12:34:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752256Ab1DCMeI (ORCPT ); Sun, 3 Apr 2011 08:34:08 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:64412 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752246Ab1DCMeH (ORCPT ); Sun, 3 Apr 2011 08:34:07 -0400 Received: by pvg12 with SMTP id 12so1047345pvg.19 for ; Sun, 03 Apr 2011 05:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=ePB6x+0ecLEu4q89otVDSK2kjV3YImZZO/DIkfqYnlQ=; b=Cgg5G1yC4Szkot6NSfzdNUWODHogh4nGs04pUO8H1Pty6pl6chazepOzfJoTWKe77v 8PJ/dSe+4FD6DdKCaC5tvLpauhbgA4l0OtNy4TVlnhvUIwBCWKDR+/LlQAsv8LO5fqB4 hkdkH3ABENHS5+2OTeSoJrL7rIHvORQCsn6yk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=dAjuWi0yGMOv8EZ+fw+QzHJLdaOweGA9KsvJLnz2Pn42jsKCMdg0ITLzuMrgiWgQpn 2MrMV9iXfeHsqCcQrfXMPA8cH8TgzlEh0YV4fNWfBARR+UhkCRgXdErVsdAZL9qgjuKU zM+ZK9QPEYNuM/X+yfV6ijHJwu7NxJ/GYMvPQ= Received: by 10.142.44.5 with SMTP id r5mr5067228wfr.300.1301834046981; Sun, 03 Apr 2011 05:34:06 -0700 (PDT) Received: from localhost (EM1-114-195-227.pool.e-mobile.ne.jp [1.114.195.227]) by mx.google.com with ESMTPS id n4sm6002677wfl.2.2011.04.03.05.34.00 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Apr 2011 05:34:05 -0700 (PDT) From: Yoshinori Sano To: linux-btrfs@vger.kernel.org Cc: chris.mason@oracle.com, Yoshinori Sano Subject: [PATCH] Btrfs: fix memory leak in start_transaction() Date: Sun, 3 Apr 2011 21:31:28 +0900 Message-Id: <1301833888-31238-1-git-send-email-yoshinori.sano@gmail.com> X-Mailer: git-send-email 1.7.1 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]); Sun, 03 Apr 2011 12:34:13 +0000 (UTC) Free btrfs_trans_handle when join_transaction() fails in start_transaction() Signed-off-by: Yoshinori Sano --- fs/btrfs/transaction.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index ce48eb5..d01cc24 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -197,6 +197,7 @@ again: ret = join_transaction(root); if (ret < 0) { + kmem_cache_free(btrfs_trans_handle_cachep, h); if (type != TRANS_JOIN_NOLOCK) mutex_unlock(&root->fs_info->trans_mutex); return ERR_PTR(ret);