From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65643C433DF for ; Thu, 18 Jun 2020 01:55:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3568920885 for ; Thu, 18 Jun 2020 01:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592445323; bh=Eair0641usXtg1g7P/Wo/pv6a4IQbpLEhlZUStc4uHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fsEZ6jWel2KFIl+2gpeY7iAnHZ/QyW1F9dYP3B+7sVtt2N551tzD1jUY7fuwW8NeD xUaXuzWyPDNdnEGVlw4dkwtVeCIpUCQuo2kzyVcbfWxbTLTnA2U/iET60hYNF0dWQY ZCixE64FptHfdpIsOQyZiYQEDFHblJx7dC9QskOs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733245AbgFRBzV (ORCPT ); Wed, 17 Jun 2020 21:55:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:32894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731499AbgFRBZs (ORCPT ); Wed, 17 Jun 2020 21:25:48 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9632E221E8; Thu, 18 Jun 2020 01:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592443547; bh=Eair0641usXtg1g7P/Wo/pv6a4IQbpLEhlZUStc4uHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bDycjg5XoSabWm9GHX1aSMDsx+3Va5sNOW+gGx5I8lYKF6KLDxYPe/J6e8c/2BIqH JDzrC3EyjgeFqj+fhgezrRsWDJgeaW5/zk7OPDXeDDLeY4/g/2I7a4Kpm6MA8oKgIY VIRZ48ju66XxHKQ1MeznVCp+FPP+qaQNgoZ9TDLA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Zhihao Cheng , David Howells , Sasha Levin , linux-afs@lists.infradead.org Subject: [PATCH AUTOSEL 4.19 163/172] afs: Fix memory leak in afs_put_sysnames() Date: Wed, 17 Jun 2020 21:22:09 -0400 Message-Id: <20200618012218.607130-163-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618012218.607130-1-sashal@kernel.org> References: <20200618012218.607130-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Zhihao Cheng [ Upstream commit 2ca068be09bf8e285036603823696140026dcbe7 ] Fix afs_put_sysnames() to actually free the specified afs_sysnames object after its reference count has been decreased to zero and its contents have been released. Fixes: 6f8880d8e681557 ("afs: Implement @sys substitution handling") Signed-off-by: Zhihao Cheng Signed-off-by: David Howells Signed-off-by: Sasha Levin --- fs/afs/proc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/afs/proc.c b/fs/afs/proc.c index 9101f62707af..e445c02dea3d 100644 --- a/fs/afs/proc.c +++ b/fs/afs/proc.c @@ -512,6 +512,7 @@ void afs_put_sysnames(struct afs_sysnames *sysnames) if (sysnames->subs[i] != afs_init_sysname && sysnames->subs[i] != sysnames->blank) kfree(sysnames->subs[i]); + kfree(sysnames); } } -- 2.25.1