From patchwork Mon Nov 29 08:03:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zefan X-Patchwork-Id: 363182 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 oAT81UPM011302 for ; Mon, 29 Nov 2010 08:01:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752354Ab0K2IB1 (ORCPT ); Mon, 29 Nov 2010 03:01:27 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:57956 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751822Ab0K2IB0 (ORCPT ); Mon, 29 Nov 2010 03:01:26 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 6B0B1170A6E; Mon, 29 Nov 2010 16:01:25 +0800 (CST) Received: from mailserver.fnst.cn.fujitus.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id oAT7uo1Z005230; Mon, 29 Nov 2010 15:56:50 +0800 Received: from lizf.localdomain ([10.167.225.51]) by mailserver.fnst.cn.fujitus.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2010112916013845-118011 ; Mon, 29 Nov 2010 16:01:38 +0800 Message-ID: <4CF35E38.4020606@cn.fujitsu.com> Date: Mon, 29 Nov 2010 16:03:04 +0800 From: Li Zefan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: linux-btrfs@vger.kernel.org CC: Sage Weil Subject: [PATCH 2/5] btrfs: Fix memory leak in a failure path References: <4CF35E17.6050705@cn.fujitsu.com> In-Reply-To: <4CF35E17.6050705@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-11-29 16:01:38, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-11-29 16:01:38, Serialize complete at 2010-11-29 16:01:38 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]); Mon, 29 Nov 2010 08:01:30 +0000 (UTC) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index d3f1a60..ba437ad 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -976,7 +976,7 @@ static noinline int btrfs_ioctl_snap_create(struct file *file, if (copy_to_user(arg + offsetof(struct btrfs_ioctl_vol_args_v2, transid), &transid, sizeof(transid))) - return -EFAULT; + ret = -EFAULT; } out: kfree(vol_args);