Commit c15d7e11 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

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: 393fc2f5 ("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.")
Reviewed-by: default avatarKumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20220907145808.1789249-1-weiyongjun@huaweicloud.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d3afabf9
...@@ -87,12 +87,13 @@ static int gp_aux_bus_probe(struct pci_dev *pdev, const struct pci_device_id *id ...@@ -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); retval = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
if (retval < 0) if (retval < 0)
return retval; goto err_aux_dev_init_1;
pdev->irq = pci_irq_vector(pdev, 0); retval = pci_irq_vector(pdev, 0);
if (pdev->irq < 0) if (retval < 0)
return retval; goto err_aux_dev_init_1;
pdev->irq = retval;
aux_bus->aux_device_wrapper[1]->gp_aux_data.irq_num = pdev->irq; 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); retval = auxiliary_device_init(&aux_bus->aux_device_wrapper[1]->aux_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment