From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A6EEF430BA3 for ; Sun, 1 Mar 2026 01:52:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329978; cv=none; b=c9lBK0aAtSAMEBcLfU/T+d3rqM++0wANoUDDSUdMYV9Ab73lm1G0B3j84koe1QNQagyy2DP1CbHqntYx7iQ8r6zWWKXmwQ9l07dNZQEVI/3YxikrYDdWuJxve7E3mZxiIf4cmd42pXq5WAkTl6pZ4oWdgVcHNvcYfgo1XbFH9mU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329978; c=relaxed/simple; bh=05H8vzArRLQ0UfdM2D+e509zFtX4OStkk3xWw5S2uuA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nUz/LbfFVi/JRLzY6nd2kzxQSilNIFxnWlY0rRRr20PNk6Ef+3x17Ir2Skcd2PGvf30a5RuXfjUAyINP4dwRkBQiQBwNiXkAmwV3ixnosU8qsAOa0wOKkluJtJ6aflxLA+MS6FSxiLBeUqwwbWEZpEYV1ZagVpxwKQAbjxZAAUA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T3ohnVAx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="T3ohnVAx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2CAEC19421; Sun, 1 Mar 2026 01:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772329978; bh=05H8vzArRLQ0UfdM2D+e509zFtX4OStkk3xWw5S2uuA=; h=From:To:Cc:Subject:Date:From; b=T3ohnVAxjdU+0/1LfF6htQAAcohWspL+cLpqxkWOk0fbV6iqkd0EP+yj5XHqMtf5f E8VgY5o2SfbyEfsa3Ri8NVVkk2Buc0XeJxFu3wJYWPm9nC2kcHnhcKq4FHWrpv464D yxK+DpMfaHcJm4S492r2HhvzkJSMAK8H89cjFGRtt+Omg+CtscDyGpnhkzbGz1Dkjw wYhMqcf1qfG3+M9mbu9Mz0cZwQJcTDdy2SuwtcwenHKCmrsSs7bBysC4/7q3xRXN66 6DEflI1K2rsoZB2V2A3winCRLCPSikvJA/C8tqIuO8OoC1z7cR8I6j+Lfh+QO3JiEN INtFQXBllRttw== From: Sasha Levin To: stable@vger.kernel.org, lihaoxiang@isrc.iscas.ac.cn Cc: Andrew Morton , Alexandre Bounine , Matt Porter Subject: FAILED: Patch "rapidio: replace rio_free_net() with kfree() in rio_scan_alloc_net()" failed to apply to 5.15-stable tree Date: Sat, 28 Feb 2026 20:52:56 -0500 Message-ID: <20260301015256.1719583-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From 666183dcdd9ad3b8156a1df7f204f728f720380f Mon Sep 17 00:00:00 2001 From: Haoxiang Li Date: Wed, 21 Jan 2026 09:35:08 +0800 Subject: [PATCH] rapidio: replace rio_free_net() with kfree() in rio_scan_alloc_net() When idtab allocation fails, net is not registered with rio_add_net() yet, so kfree(net) is sufficient to release the memory. Set mport->net to NULL to avoid dangling pointer. Link: https://lkml.kernel.org/r/20260121013508.195836-1-lihaoxiang@isrc.iscas.ac.cn Fixes: e6b585ca6e81 ("rapidio: move net allocation into core code") Signed-off-by: Haoxiang Li Reviewed-by: Andrew Morton Cc: Alexandre Bounine Cc: Matt Porter Cc: Signed-off-by: Andrew Morton --- drivers/rapidio/rio-scan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c index c12941f71e2cb..dcd6619a4b027 100644 --- a/drivers/rapidio/rio-scan.c +++ b/drivers/rapidio/rio-scan.c @@ -854,7 +854,8 @@ static struct rio_net *rio_scan_alloc_net(struct rio_mport *mport, if (idtab == NULL) { pr_err("RIO: failed to allocate destID table\n"); - rio_free_net(net); + kfree(net); + mport->net = NULL; net = NULL; } else { net->enum_data = idtab; -- 2.51.0