Skip to contentSkip to conversation

irqchip: irq-alpine-msi: releasing the wrong variable on error

PATCH New Dan Carpenter 2 participants 2 messages Mar 11, 2016

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

PATCH 1/1 irqchip: irq-alpine-msi: releasing the wrong variable on error

The "msi_domain" variable is NULL here so it leads to a NULL dereference. It looks like we actually intended to free "middle_domain".

Fixes e6b78f2c3e14 ('irqchip: Add the Alpine MSIX interrupt controller')
drivers/irqchip/irq-alpine-msi.c +1 -1
index f871272..2538425 100644
@@ -220,7 +220,7 @@ static int alpine_msix_init_domains(struct alpine_msix_data *priv,
 					       middle_domain);
 	if (!msi_domain) {
 		pr_err("Failed to create MSI domain\n");
-		irq_domain_remove(msi_domain);
+		irq_domain_remove(middle_domain);
 		return -ENOMEM;
 	}
 
#1 lore raw

[tip:irq/core] irqchip/irq-alpine-msi: Release the correct domain on error

irqchip/irq-alpine-msi: Release the correct domain on error
Commit-ID:  143d36a33b4d59a56bb8e913a17a105578fd3237
Gitweb:     http://git.kernel.org/tip/143d36a33b4d59a56bb8e913a17a105578fd3237
Author:     Dan Carpenter <[email protected]>
AuthorDate: Fri, 11 Mar 2016 11:14:43 +0300
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Fri, 11 Mar 2016 10:06:55 +0100

irqchip/irq-alpine-msi: Release the correct domain on error

The "msi_domain" variable is NULL here so it leads to a NULL dereference. It looks like we actually intended to free "middle_domain".

Fixes e6b78f2c3e14 ('irqchip: Add the Alpine MSIX interrupt controller')
Cc Jason Cooper <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Antoine Tenart <[email protected]>
Cc Tsahee Zidenberg <[email protected]>
---
 drivers/irqchip/irq-alpine-msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-alpine-msi.c +1 -1
index f871272..2538425 100644
@@ -220,7 +220,7 @@ static int alpine_msix_init_domains(struct alpine_msix_data *priv,
 					       middle_domain);
 	if (!msi_domain) {
 		pr_err("Failed to create MSI domain\n");
-		irq_domain_remove(msi_domain);
+		irq_domain_remove(middle_domain);
 		return -ENOMEM;
 	}