Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 5EA36356A0D; Sat, 12 Sep 2026 11:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789212007; cv=none; b=a4Aum+TUy/nOhfWL89RgpNjSRnQHAVTBb/UwfepDUYFYrHKtUzCIKwouq6sZ2HXoFlSN1HgyUXL83KsIdhka9TtHVSCJJp9xPZ61abfM0ZvXXfQDMIXPG7YzmLf8mreDW57qv7KP8cdJ+H3KRzLSZN8pKj/jU83oHRpI/RLH2yk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789212007; c=relaxed/simple; bh=yaO2Asd1mCrQSFttvRdbF1xhVoc54ZSLv0QaFxAaMvU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aHhkUcsxpqsNj0j6hT96SerEdfhlny9CMIW5y/WAc4GM4Fhm5WuYicEMyHq6VEG/0AjqS4uwH3tyx5M04XhUJk5AzUoDU3vGM+NQNzjiKA/rgJvHRjyYUrNxIBu+YJgv5dC8zvuVOzlL8jfwO08olxkvc0yCWs1aLL9mt6yA6CA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=L+g0M7F9; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="L+g0M7F9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03D1D1F000FF; Sat, 12 Sep 2026 11:20:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789212006; bh=hLjZo7mZ6/+MqbBzVO5EIFEy+A8rqnZx/Mn5Qmc5Yig=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=L+g0M7F93Hf+w9PRyxiy+7K+/Og+wE1mLfzUtV1YMnbCbg23D5h8VqEqWSdNypCCW 3qeEqsX/zAB8aDCXhnHO01ol7nXLNAYBLtSpvm6fv13/gKEJhokDQyRLhIePXhs/ff og0d8zyhQl9+R6kqsZ1ufFK5Qd8mUCcSa59WrCTc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ruoyu Wang , Alex Elder , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 1349/1518] net: ipa: balance runtime PM reference on remove error Date: Sat, 12 Sep 2026 08:58:38 +0200 Message-ID: <20260912065654.045784838@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ruoyu Wang [ Upstream commit 6b9eaa61ff2df63c6eb35d5cd025e2cef0861d76 ] ipa_remove() takes a runtime PM reference before accessing IPA hardware during teardown. If a concurrent modem start or stop keeps ipa_modem_stop() busy across both attempts, the callback intentionally returns without releasing the remaining resources because proceeding with teardown could crash. That return also skips the matching pm_runtime_put_noidle(), leaving the callback's usage-count reference held. Drop only this runtime PM reference before returning. pm_runtime_put_noidle() does not request an idle transition, so the hardware and resources retained on this exceptional path remain untouched while the usage count stays balanced. This issue was found by a static analysis checker and confirmed by manual source review. Fixes: 923a6b698447 ("net: ipa: get clock in ipa_probe()") Signed-off-by: Ruoyu Wang Reviewed-by: Alex Elder Link: https://patch.msgid.link/20260815151737.3758320-1-ruoyuw560@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ipa/ipa_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 30fe12e3582b2..eadd389134579 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -966,12 +966,12 @@ static void ipa_remove(struct platform_device *pdev) } if (ret) { /* - * Not cleaning up here properly might also yield a - * crash later on. As the device is still unregistered - * in this case, this might even yield a crash later on. + * Continuing teardown after failing to stop the modem + * could crash, so leave the remaining resources allocated. */ dev_err(dev, "Failed to stop modem (%pe), leaking resources\n", ERR_PTR(ret)); + pm_runtime_put_noidle(dev); return; } -- 2.53.0