From patchwork Sun Mar 13 20:49:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Juhl X-Patchwork-Id: 632111 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 p2DKo0Jq015827 for ; Sun, 13 Mar 2011 20:50:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932177Ab1CMUtl (ORCPT ); Sun, 13 Mar 2011 16:49:41 -0400 Received: from swampdragon.chaosbits.net ([90.184.90.115]:20635 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755382Ab1CMUtk (ORCPT ); Sun, 13 Mar 2011 16:49:40 -0400 Received: by swampdragon.chaosbits.net (Postfix, from userid 1000) id 2AB4C9403D; Sun, 13 Mar 2011 21:49:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by swampdragon.chaosbits.net (Postfix) with ESMTP id 1D16B9403B; Sun, 13 Mar 2011 21:49:19 +0100 (CET) Date: Sun, 13 Mar 2011 21:49:18 +0100 (CET) From: Jesper Juhl To: linux-btrfs@vger.kernel.org cc: linux-kernel@vger.kernel.org, Chris Mason Subject: [PATCH] BTRFS: Fix mem leak in btrfs_submit_direct() 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]); Sun, 13 Mar 2011 20:50:00 +0000 (UTC) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 0efdb65..53f4c8e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6056,6 +6056,7 @@ static void btrfs_submit_direct(int rw, struct bio *bio, struct inode *inode, if (!skip_sum) { dip->csums = kmalloc(sizeof(u32) * bio->bi_vcnt, GFP_NOFS); if (!dip->csums) { + kfree(dip); ret = -ENOMEM; goto free_ordered; }