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: adjust the partial logic of cdnsp_pci_remove

In cdnsp_pci_remove, if pci_is_enabled returns true, it will
call cdns_remove; else it will call kfree. Then both control flow
goes to pci_dev_put.

Adjust this logic by modifying it to an if else.

Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
Acked-by: Pawel Laszczak <pawell@cadence.com>
Link: https://lore.kernel.org/r/20221009072305.1593707-1-dzm91@hust.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dongliang Mu and committed by
Greg Kroah-Hartman
90732f17 27ef01e3

+3 -5
+3 -5
drivers/usb/cdns3/cdnsp-pci.c
··· 192 192 if (pci_dev_run_wake(pdev)) 193 193 pm_runtime_get_noresume(&pdev->dev); 194 194 195 - if (!pci_is_enabled(func)) { 195 + if (pci_is_enabled(func)) { 196 + cdns_remove(cdnsp); 197 + } else { 196 198 kfree(cdnsp); 197 - goto pci_put; 198 199 } 199 200 200 - cdns_remove(cdnsp); 201 - 202 - pci_put: 203 201 pci_dev_put(func); 204 202 } 205 203