linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe()
@ 2022-09-07  8:34 Wei Yongjun
  2022-09-07  8:34 ` [PATCH -next 2/5] misc: microchip: pci1xxxx: Fix missing spin_lock_init() Wei Yongjun
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Wei Yongjun @ 2022-09-07  8:34 UTC (permalink / raw)
  To: Kumaravel Thiagarajan, Arnd Bergmann, Greg Kroah-Hartman
  Cc: Wei Yongjun, linux-gpio, kernel-janitors

From: Wei Yongjun <weiyongjun1@huawei.com>

In some error handling path, resoures alloced may not released.
This patch fix them.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c
index bfc03028b34d..11f79f239006 100644
--- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c
+++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c
@@ -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_ida_alloc_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);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-09-08  6:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-07  8:34 [PATCH -next 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe() Wei Yongjun
2022-09-07  8:34 ` [PATCH -next 2/5] misc: microchip: pci1xxxx: Fix missing spin_lock_init() Wei Yongjun
2022-09-07 13:10   ` Kumaravel.Thiagarajan
2022-09-07  8:34 ` [PATCH -next 3/5] misc: microchip: pci1xxxx: Make symbol 'pci1xxxx_gpio_auxiliary_id_table' static Wei Yongjun
2022-09-07 13:19   ` Kumaravel.Thiagarajan
2022-09-07  8:34 ` [PATCH -next 4/5] misc: microchip: pci1xxxx: Add missing MODULE_DEVICE_TABLE Wei Yongjun
2022-09-07 13:37   ` Kumaravel.Thiagarajan
2022-09-07  8:34 ` [PATCH -next 5/5] misc: microchip: pci1xxxx: use module_auxiliary_driver Wei Yongjun
2022-09-07 14:35   ` Kumaravel.Thiagarajan
2022-09-07 14:47     ` Greg KH
2022-09-08  6:39       ` Kumaravel.Thiagarajan
2022-09-07 11:56 ` [PATCH -next 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe() Kumaravel.Thiagarajan
2022-09-07 14:40   ` Wei Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).