From patchwork Wed Mar 9 16:46:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel J Blueman X-Patchwork-Id: 621831 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 p29GkWRv027160 for ; Wed, 9 Mar 2011 16:47:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932765Ab1CIQqo (ORCPT ); Wed, 9 Mar 2011 11:46:44 -0500 Received: from mail-iw0-f174.google.com ([209.85.214.174]:59641 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932275Ab1CIQqn convert rfc822-to-8bit (ORCPT ); Wed, 9 Mar 2011 11:46:43 -0500 Received: by iwn34 with SMTP id 34so664895iwn.19 for ; Wed, 09 Mar 2011 08:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=HNSbyomYGObRXUTPv2VrptV14aINyEaUH5gIBiWdEPM=; b=qIhqu+YNPBSv6cYPAW+rHTpR6ik3Ls9SpGoUn5wflZkh4qNUOuND1qQ4qSNzXs2ktq iKLgdaL5vrSxNKASeFGfqXVw/HgBaizq1IP2UoDwaJtsGQhFo9SuL3N6DBhHeu1o079P atiDWLM3u3WPuV3fn5rBrymF8kdcePDDaZ0Rg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=K7Uo4hNZM9pmqrpBAn8XrQEGCx8/Xso209z2wJT9O03mJUA//FGTNvqTZN+5gG2RaE ie+V+rAnopMo+yoVkzsN65oz/1jz7s8uvyJgz4k+fPXnup+1SiUmI/2rfjb1NxUwizYV GqKp6tufenHR0LzWjhOhl0uXZcSSJ1QIpJICU= MIME-Version: 1.0 Received: by 10.43.134.1 with SMTP id ia1mr190364icc.127.1299689202693; Wed, 09 Mar 2011 08:46:42 -0800 (PST) Received: by 10.231.139.156 with HTTP; Wed, 9 Mar 2011 08:46:42 -0800 (PST) Date: Thu, 10 Mar 2011 00:46:42 +0800 Message-ID: Subject: [PATCH] btrfs: fix dip leak From: Daniel J Blueman To: miaox@cn.fujitsu.com, Josef Bacik , Chris Mason , Linux Btrfs Cc: Ito 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]); Wed, 09 Mar 2011 16:47:07 +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;