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 92D8A2F39BE for ; Sun, 1 Mar 2026 02:02:55 +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=1772330575; cv=none; b=rztsxE7LlvP4yqSlulSJU6xH/bmTa0XohkCDBZEjiLeeDSbNSOSo43I88hHdu5kjq3Sg8KYubNmVxJObDEQnEGZw4ap53g/CZAvdsmArGkNuAY/3os8lRNw1LbwTUT92INxuxAomXe1W8kSosSmAOA3inboBZyqwXbBssTedTAI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772330575; c=relaxed/simple; bh=BFi/3XGd2R89tXXV5aaDr3W9A2DMeFgKI1tae4DzzPc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=iKL842eWhs0RGCRpEtKP6tNcLSJoI2VVjbbMZ7Qy2Qga343EZ+pIm/VXFDJeyMh9qfHoJIVByenPMmyv0JQoMJeY8LpvVgDnxSRlevRhAy1InRRg74cqOxbfEXt/BNrqGNZwbO+9VGL0Q2D8Hky+ywr63fjpBi0fdpLPsvMooCo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Qi+gOWS9; 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="Qi+gOWS9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9121C2BC86; Sun, 1 Mar 2026 02:02:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772330575; bh=BFi/3XGd2R89tXXV5aaDr3W9A2DMeFgKI1tae4DzzPc=; h=From:To:Cc:Subject:Date:From; b=Qi+gOWS9+el6ecizycxkQ3pFNgUhIs4pKfhEhJxbfWU4Un5YIQSVuzK/2RX1JxsiG a7mzeMblrtoMQYbtvqfYk8P+r+hbpQnxT5Nkocj8bdMyxu14c2Uyp1GP7ZbSENaprF J6A/StxLEfSpE9oUwO47mrfcbTSdY9NOmPCGaaNoSb4Dk6RcOFM/gNB1Ajvl002Bkj 2AYaJP+3goI8wgkyKAXTKdKrXUp5YkM+xCXmlaUptUINHVP59ien7fNEbGe+Nc1pRH OqCBIbFBeP+EeF1Yg99pUYJdLBYhtvotH34DucJFlI/Qq+m91bxkkTMfBQ5UEFwpMJ UHtpz6DJ2c/YA== 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.10-stable tree Date: Sat, 28 Feb 2026 21:02:53 -0500 Message-ID: <20260301020253.1730819-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.10-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