Skip to contentSkip to conversation

xen/mcelog: Use common error handling code in bind_virq_for_mce()

PATCH New Markus Elfring 1 participant 1 message Jun 10

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/mcelog: Use common error handling code in bind_virq_for_mce()

From: Markus Elfring <[email protected]>
Date: Wed, 10 Jun 2026 17:05:22 +0200
Subject: [PATCH] xen/mcelog: Use common error handling code in bind_virq_for_mce()

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.

---
 drivers/xen/mcelog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/xen/mcelog.c +2 -2
index 53a8720f5cae..df15d5cf6d4c 100644
@@ -380,14 +380,14 @@ static int bind_virq_for_mce(void)
 	ret = HYPERVISOR_mca(&mc_op);
 	if (ret) {
 		pr_err("Failed to get CPU info\n");
-		kfree(g_physinfo);
-		return ret;
+		goto free_info;
 	}
 
 	ret  = bind_virq_to_irqhandler(VIRQ_MCA, 0,
 				       xen_mce_interrupt, 0, "mce", NULL);
 	if (ret < 0) {
 		pr_err("Failed to bind virq\n");
+free_info:
 		kfree(g_physinfo);
 		return ret;
 	}
Signature · 1 line
2.54.0