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 BF42A208D0; Sat, 12 Sep 2026 09:19:05 +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=1789204746; cv=none; b=l/JFI5xUpSHmfC7+NTDAU86PImxI2ZgtHiGb3xUus+BiqDjYse/tzbc+BynJPO0oM6lnQPU4Nj4VXmLUBbx43dWruEGPZjYy/asbJrIYaSg65DFxazBhqhs9LShn85QSMMyGEgaIngk+umXtpSmuHH0uWHBIIZEPZPA+RTYQgic= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789204746; c=relaxed/simple; bh=9BxRcf2awNSD6CzrattRNKZFxCB+ggjFDYVgTNcDaLo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Fs9rYdSLye+kvivhi2i6vJZQPyjARwXUXRbAf42FF2WZQDGYIapU8toIGSbGL3JQlxMvTXocEpHa4/tCtGPDVtmoXIAMFCD7p3fZ3l6bxpeRxZ1qv+TZw0NyKXTq8/cC+x3Hl1Vs7bPW8AQPhdxyDTpzQMmgFKnpwG8BQ5R3Kqo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BdNEf72O; 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="BdNEf72O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94F041F000FF; Sat, 12 Sep 2026 09:19:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789204745; bh=O/dLBXPselZv4Zcj/2cfoM5X/C0sJOK0LV3drqKivjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BdNEf72OdkNBp3ZRKMLZIdQlPzD1ToGk317Qg7cWX0n0rwoKWD4Z8baLNQ/+PwBth 8zIBEAolGC+lw0ARL72/wiT2W2EEg3Xxp5xTr53evl3yDIpAYdqFB6l1x8REw9TZlC z+2ba3O488k7q3/9gmcN4wNLMoPYtEYqOgvCv49g= 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 7.2 1675/1815] net: ipa: balance runtime PM reference on remove error Date: Sat, 12 Sep 2026 08:57:05 +0200 Message-ID: <20260912065728.309767655@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065648.999753832@linuxfoundation.org> References: <20260912065648.999753832@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 7.2-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 788dd99af2a4d..8d82fd5bb24b9 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -969,12 +969,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