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 B8030352F8B; Wed, 3 Dec 2025 16:15:03 +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=1764778503; cv=none; b=dsPFsX3UWthoVKqal3b/bbX8YduUnNZwlo283TXZ54yYM0vgvi9bPLRkbQpBa/hEMlCRHM903fTrho45nsoHQD2Jhb/ea0OldpFjp49/7q+Ffq12tYgA8bV634E2neerU8c4+cSMX0eXKCJKrvB2CYQKPsFIFOS0C/nFpUIuWQQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764778503; c=relaxed/simple; bh=3Sw9hWKldzHEUJfIJUhBWashDMr2isW+ZQyUZEp7sX0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fH6D9E7uK2cryFYeAu0Uce/piulNCilkuKJhPO9HWUymNYpOj3KvLhvHY+kDrNNz/vs3V8nJ7Emh2zv1ZR1G9ch10FJZA0ggXLk+dWY+9vBCS6PRCpSt62SeTfCwEYjZgHyxijq/eSBay6GaOA2tCGFf+sy4r5yjLXq7si1wxbo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Er6WQ0NA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Er6WQ0NA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 267A6C4CEF5; Wed, 3 Dec 2025 16:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764778503; bh=3Sw9hWKldzHEUJfIJUhBWashDMr2isW+ZQyUZEp7sX0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Er6WQ0NAALJj6V0QH+5h1bxORgoqnyixsSYbG0u4P9/Rxwln/wddDr1cW+4JUIhc2 zol2o+O6YqY+FYXATOkQimx+ySXqANioTpj+zchacRv5GoqJ8GcFYGnbZ+V5wXsVNU y6PF+ruUl4QfJSXzBaqz4XEzLYeuye+B4h2Ei9Ng= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Miaoqian Lin , Peter Chen Subject: [PATCH 5.15 365/392] usb: cdns3: Fix double resource release in cdns3_pci_probe Date: Wed, 3 Dec 2025 16:28:35 +0100 Message-ID: <20251203152427.594770595@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251203152414.082328008@linuxfoundation.org> References: <20251203152414.082328008@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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miaoqian Lin commit 1ec39d2cd88dac2e7cdbac248762f1f057971c5d upstream. The driver uses pcim_enable_device() to enable the PCI device, the device will be automatically disabled on driver detach through the managed device framework. The manual pci_disable_device() calls in the error paths are therefore redundant and should be removed. Found via static anlaysis and this is similar to commit 99ca0b57e49f ("thermal: intel: int340x: processor: Fix warning during module unload"). Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") Cc: stable Signed-off-by: Miaoqian Lin Acked-by: Peter Chen Link: https://patch.msgid.link/20251026090859.33107-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/cdns3/cdns3-pci-wrap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/usb/cdns3/cdns3-pci-wrap.c +++ b/drivers/usb/cdns3/cdns3-pci-wrap.c @@ -101,10 +101,8 @@ static int cdns3_pci_probe(struct pci_de wrap = pci_get_drvdata(func); } else { wrap = kzalloc(sizeof(*wrap), GFP_KERNEL); - if (!wrap) { - pci_disable_device(pdev); + if (!wrap) return -ENOMEM; - } } res = wrap->dev_res; @@ -163,7 +161,6 @@ static int cdns3_pci_probe(struct pci_de /* register platform device */ wrap->plat_dev = platform_device_register_full(&plat_info); if (IS_ERR(wrap->plat_dev)) { - pci_disable_device(pdev); err = PTR_ERR(wrap->plat_dev); kfree(wrap); return err;