Skip to content

Commit acad205

Browse files
Yuuoniygregkh
authored andcommitted
usb: cdns3: cdnsp-pci: remove redundant pci_disable_device() call
commit e9c2063 upstream. 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 99ca0b5 ("thermal: intel: int340x: processor: Fix warning during module unload"). Fixes: 3d82904 ("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>
1 parent 5c25a2a commit acad205

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/usb/cdns3/cdnsp-pci.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,
9090
cdnsp = kzalloc(sizeof(*cdnsp), GFP_KERNEL);
9191
if (!cdnsp) {
9292
ret = -ENOMEM;
93-
goto disable_pci;
93+
goto put_pci;
9494
}
9595
}
9696

@@ -173,9 +173,6 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,
173173
if (!pci_is_enabled(func))
174174
kfree(cdnsp);
175175

176-
disable_pci:
177-
pci_disable_device(pdev);
178-
179176
put_pci:
180177
pci_dev_put(func);
181178

0 commit comments

Comments
 (0)