From patchwork Sat Mar 20 11:24:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 87098 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2KBPNbN005207 for ; Sat, 20 Mar 2010 11:25:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751832Ab0CTLZA (ORCPT ); Sat, 20 Mar 2010 07:25:00 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:55527 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751750Ab0CTLY6 (ORCPT ); Sat, 20 Mar 2010 07:24:58 -0400 Received: by bwz1 with SMTP id 1so660036bwz.21 for ; Sat, 20 Mar 2010 04:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mail-followup-to:mime-version:content-type :content-disposition:user-agent; bh=SvAZSDzhC3r6QV7YU6awVf8xUk3qoaHYtIFaBZPH9y8=; b=MhJ06VqHgnsoTUqhHvxyieoX9G0+gDbi6DnVi1euAof7yijAh6sZhv1vEyXeMctha0 IlUVXMzzq1JjVBnV0d/H8/g4iEzQ5qwpckPtyodnpIRVkjF7xDkn0u/RdMKYo4VURpNE GCEpvgpeXYm/Mh6qlg7IW/zvEIsM6g+44iLXY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; b=QRLo7/eUJ29LNqGO21wvkW+goGmXqW7rXmBFmkSKfP7AIDhBl8XECjZDJY0pjGbPbb /qo4M8XAkfcqCInTttPZFsWKU+VymWLhV67zybrb28KynEj5iwQL6ZELxLg47OG8VP2u a7Za+V/UGhQKJRCbpXrWORU9nE3Lum/WbpkJk= Received: by 10.204.75.35 with SMTP id w35mr2340818bkj.194.1269084296801; Sat, 20 Mar 2010 04:24:56 -0700 (PDT) Received: from bicker ([196.43.68.220]) by mx.google.com with ESMTPS id 24sm9033527bkr.0.2010.03.20.04.24.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 20 Mar 2010 04:24:56 -0700 (PDT) Date: Sat, 20 Mar 2010 14:24:48 +0300 From: Dan Carpenter To: Chris Mason Cc: Yan Zheng , Josef Bacik , Sage Weil , Al Viro , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch 3/3] btrfs: dereferencing freed memory Message-ID: <20100320112448.GX5331@bicker> Mail-Followup-To: Dan Carpenter , Chris Mason , Yan Zheng , Josef Bacik , Sage Weil , Al Viro , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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 (demeter.kernel.org [140.211.167.41]); Sat, 20 Mar 2010 11:25:23 +0000 (UTC) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index be9b5df..d7ab56c 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1378,6 +1378,7 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp) sizeof(*range))) { ret = -EFAULT; kfree(range); + goto out; } /* compression requires us to start the IO */ if ((range->flags & BTRFS_DEFRAG_RANGE_COMPRESS)) {