Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3876007pxb; Tue, 17 Nov 2020 06:01:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEdse/k+lzhP5BIkYderma2Kh53P5Hc/llEw5zZo5QxJNnto2Fe3j4XcnWS7sa2LYDZ2Sb X-Received: by 2002:a17:906:5fd9:: with SMTP id k25mr20553662ejv.166.1605621667538; Tue, 17 Nov 2020 06:01:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605621667; cv=none; d=google.com; s=arc-20160816; b=kG5ggzNlblouFjb7rzjGsMlzks+U862qrgpp1+me3qJ+OFz/XAujx59nUHts0lqKPv acTvZ3Q4LcElqtxGqVVwkRjeccH8vTt5POx/4k17DTgDu4Y7nKX3zEvOffjjgiKTcuDR JgkhNUJ0lWhIn2w6HdAmYnD1MAJ42omriOFaxoFUakJxqbFEGqibyP1gaQdLB1DLmB6g m8R4JZebiwKULNBL/oo6D/Ew3m/P6ZhBxVSIhkbIrRQD0Y9T20qc/wfW3qFldC4VkuZE qHwm48BUi65iG5O1Nb4RG9hZTmJRzsXh6uEIHd68uyoJKAzaYjQfW7/r4og5orvepo9w ju9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H+hzlf3CvafV/X6SecywwUQgFpR6BdswVfxdQuF3LFk=; b=ytkC1ILs11EioXrdiDp/MuZaVNeOK5WYUbasj2JTHvMnf7Z2e75xt/iJ5NKL8LFXPE KDwV534T36rg6I+J/TUuD32JfePDTwjQTjGt1ibB5Tg7jaOJt2LyCp+27OiaEvRyyFQw vb3q53lAG1ENH/jkxWaNaGK61gAvFqW7hoQeT9mMenQrWoTMmz3EOsbOlEvyxZ7W4qDZ 6KbQ+qMYqI6Dn9T9cJWXZIrJdCvI4OG9pFxh0vcuaaSKmT7fqviPVs2U34ElDuIMUIfm 149QHlRWQKSkbJQe7dyOQr1FDdzZVPhY9bcn0smDbhLuQQqAsqed9iWazp2kbYYA2JC4 72VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NQo1rxRb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q18si2621917eju.4.2020.11.17.06.00.44; Tue, 17 Nov 2020 06:01:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NQo1rxRb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730513AbgKQNUS (ORCPT + 99 others); Tue, 17 Nov 2020 08:20:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:53538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730497AbgKQNUO (ORCPT ); Tue, 17 Nov 2020 08:20:14 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2E001241A6; Tue, 17 Nov 2020 13:20:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619213; bh=Mvj3gVzoj/k0E8gkhN7B6i6pAWOOJtOxpd7fhYJfhuo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NQo1rxRb/lKPbsehardJ/vfMZ+sJjI3diGu5dBaK0G6RVxK7/8ctNjZn3zgG59w+e ctMQuxsu63CsEI4R2l/WSd0QmlXLuuWykvqtu9anVBefXvc+DbQ77JUoYicwxoWyjc XOrIY7nAmzQviYSUidSK9gZVXF3kbVqMBS/ehnfs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josef Bacik , Dinghao Liu , David Sterba Subject: [PATCH 4.19 065/101] btrfs: ref-verify: fix memory leak in btrfs_ref_tree_mod Date: Tue, 17 Nov 2020 14:05:32 +0100 Message-Id: <20201117122116.274364522@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu commit 468600c6ec28613b756193c5f780aac062f1acdf upstream. There is one error handling path that does not free ref, which may cause a minor memory leak. CC: stable@vger.kernel.org # 4.19+ Reviewed-by: Josef Bacik Signed-off-by: Dinghao Liu Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/ref-verify.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/btrfs/ref-verify.c +++ b/fs/btrfs/ref-verify.c @@ -854,6 +854,7 @@ int btrfs_ref_tree_mod(struct btrfs_root "dropping a ref for a root that doesn't have a ref on the block"); dump_block_entry(fs_info, be); dump_ref_action(fs_info, ra); + kfree(ref); kfree(ra); goto out_unlock; }