mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe()
In some error handling path, resoures alloced may not released.
This patch fix them.
Fixes: 393fc2f594
("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.")
Reviewed-by: Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20220907145808.1789249-1-weiyongjun@huaweicloud.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d3afabf94a
commit
c15d7e11ae
1 changed files with 5 additions and 4 deletions
|
@ -87,12 +87,13 @@ static int gp_aux_bus_probe(struct pci_dev *pdev, const struct pci_device_id *id
|
|||
retval = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
|
||||
|
||||
if (retval < 0)
|
||||
return retval;
|
||||
goto err_aux_dev_init_1;
|
||||
|
||||
pdev->irq = pci_irq_vector(pdev, 0);
|
||||
if (pdev->irq < 0)
|
||||
return retval;
|
||||
retval = pci_irq_vector(pdev, 0);
|
||||
if (retval < 0)
|
||||
goto err_aux_dev_init_1;
|
||||
|
||||
pdev->irq = retval;
|
||||
aux_bus->aux_device_wrapper[1]->gp_aux_data.irq_num = pdev->irq;
|
||||
|
||||
retval = auxiliary_device_init(&aux_bus->aux_device_wrapper[1]->aux_dev);
|
||||
|
|
Loading…
Reference in a new issue