* [PATCH] PCI: pnv_php: Use common error handling code in pnv_php_alloc_slot()
@ 2026-06-11 9:25 Markus Elfring
0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2026-06-11 9:25 UTC (permalink / raw)
To: linux-pci, linuxppc-dev, Bjorn Helgaas, Christophe Leroy,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin
Cc: LKML, kernel-janitors, Ilpo Järvinen, Jonathan Cameron,
Krzysztof Kozlowski
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 11 Jun 2026 11:16:49 +0200
Use an additional label so that a bit of exception handling can be better
reused at the end of an if branch.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/pci/hotplug/pnv_php.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c
index ff92a5c301b8..e448f1802002 100644
--- a/drivers/pci/hotplug/pnv_php.c
+++ b/drivers/pci/hotplug/pnv_php.c
@@ -791,16 +791,15 @@ static struct pnv_php_slot *pnv_php_alloc_slot(struct device_node *dn)
return NULL;
php_slot->name = kstrdup(label, GFP_KERNEL);
- if (!php_slot->name) {
- kfree(php_slot);
- return NULL;
- }
+ if (!php_slot->name)
+ goto free_php_slot;
/* Allocate workqueue for this slot's interrupt handling */
php_slot->wq = alloc_workqueue("pciehp-%s", WQ_PERCPU, 0, php_slot->name);
if (!php_slot->wq) {
SLOT_WARN(php_slot, "Cannot alloc workqueue\n");
kfree(php_slot->name);
+free_php_slot:
kfree(php_slot);
return NULL;
}
--
2.54.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-11 9:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11 9:25 [PATCH] PCI: pnv_php: Use common error handling code in pnv_php_alloc_slot() Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox