Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: cdns3: cdnsp-pci: remove redundant pci_disable_device() call

The cdnsp-pci driver uses pcim_enable_device() to enable a PCI device,
which means the device will be automatically disabled on driver detach
through the managed device framework. The manual pci_disable_device()
call in the error path is therefore redundant.

Found via static anlaysis and this is similar to commit 99ca0b57e49f
("thermal: intel: int340x: processor: Fix warning during module unload").

Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20250903141613.2535472-1-linmq006@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Miaoqian Lin and committed by
Greg Kroah-Hartman
e9c20632 1c208fd3

+1 -4
+1 -4
drivers/usb/cdns3/cdnsp-pci.c
··· 85 85 cdnsp = kzalloc(sizeof(*cdnsp), GFP_KERNEL); 86 86 if (!cdnsp) { 87 87 ret = -ENOMEM; 88 - goto disable_pci; 88 + goto put_pci; 89 89 } 90 90 } 91 91 ··· 167 167 free_cdnsp: 168 168 if (!pci_is_enabled(func)) 169 169 kfree(cdnsp); 170 - 171 - disable_pci: 172 - pci_disable_device(pdev); 173 170 174 171 put_pci: 175 172 pci_dev_put(func);