From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74A25338911 for ; Fri, 23 Jan 2026 08:09:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769155793; cv=none; b=YjnCBJY9uCOZp3GkC4wCgWp18TT/qxhBL+kwvESog4hTClUbfnnjhwvMHIZJp5yw6roz4i8LbAO1Nbldd5ouiAbPl+5/eccE7l1ix++eyo2ruK3XN0/4x3Dh1eMl21HzvXwOnLDJUcrCo2Obi6nOG3H3ph6nImQhiQRwQUXx+Nw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769155793; c=relaxed/simple; bh=tR3sZW6jYtInuvVcPkPF69rvDcAsL3acmVG2zLsyMlY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EeuqsNJ8MZsyeaE94HLLelK8tDU0LuFZUOKr4iRCNgiMbt79bIfEPFfWvfZj2+Ruku+JX6I6Nw/SPokvg5DEBubYybcse7k//Rn6Kxnqmr/q+bQtWkQ15URW+VvppPKBhb4R0Fq5gvR2lWIRoKwrx12b5RbsyHzXs4QAqxYbQ2M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=dLgAvyy9; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="dLgAvyy9" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 44E694E42216; Fri, 23 Jan 2026 08:09:47 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id F0E286070A; Fri, 23 Jan 2026 08:09:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 3ABB2119A8794; Fri, 23 Jan 2026 09:09:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1769155785; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:content-language:in-reply-to:references; bh=avpNbejQVhcRwN5fLLkgDSir1StlELzVRnwamqKBB0w=; b=dLgAvyy9xth2EbBZiiTwdhv6IdHWqUpCq8+2FTEyM3BV7DI7IcdEIjlqn97SlrEsuimoK4 lDbwVEyptmwpJhv9hzcG9Rq+uqLZ8K+qMstkf5ifeeeqDC08TdMCsHoIW125+57h1XU0yk QBYkgreqQnS03Czr3so+ch5Y5Rm64l7PGnyJUfc7IS7KxrYuQEExD0FUWPZLd7R5JWwDhx vYURtHUKOYaELo60YH/PImA6qAyuJ6f1Cm7TPGyeuRXhh4QTdZ3NtXHfk1wcAQ3xrgshb2 jtAmtMkcE+9temkACZuhAk5z9KptI/ztm7uGaEX4Rmgxm7CfUv20j3RqJ7S9Lw== Message-ID: <8e7a73ed-1488-4d13-807c-f17c04c160e7@bootlin.com> Date: Fri, 23 Jan 2026 09:09:38 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v2] net: mvpp2: cls: Fix memory leak in mvpp2_ethtool_cls_rule_ins() To: Zilin Guan , marcin.s.wojtas@gmail.com Cc: linux@armlinux.org.uk, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jianhao.xu@seu.edu.cn References: <20260123065716.2248324-1-zilin@seu.edu.cn> From: Maxime Chevallier Content-Language: en-US In-Reply-To: <20260123065716.2248324-1-zilin@seu.edu.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 Hi, On 23/01/2026 07:57, Zilin Guan wrote: > In mvpp2_ethtool_cls_rule_ins(), the ethtool_rule is allocated by > ethtool_rx_flow_rule_create(). If the subsequent conversion to flow > type fails, the function jumps to the clean_rule label. > > However, the clean_rule label only frees efs, skipping the cleanup > of ethtool_rule, which leads to a memory leak. > > Fix this by jumping to the clean_eth_rule label, which properly calls > ethtool_rx_flow_rule_destroy() before freeing efs. > > Compile tested only. Issue found using a prototype static analysis tool > and code review. Thanks for clarifying how you found that > > Fixes: f4f1ba18195d ("net: mvpp2: cls: Report an error for unsupported flow types") > Signed-off-by: Zilin Guan Change is fine, thanks for fixing this. Reviewed-by: Maxime Chevallier Maxime