Commit 23357b61 authored by Thomas Gleixner's avatar Thomas Gleixner

iommu/amd: Prevent NULL pointer dereference

Dereferencing irq_data before checking it for NULL is suboptimal.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 856deb86
...@@ -3731,8 +3731,8 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, ...@@ -3731,8 +3731,8 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq,
for (i = 0; i < nr_irqs; i++) { for (i = 0; i < nr_irqs; i++) {
irq_data = irq_domain_get_irq_data(domain, virq + i); irq_data = irq_domain_get_irq_data(domain, virq + i);
cfg = irqd_cfg(irq_data); cfg = irq_data ? irqd_cfg(irq_data) : NULL;
if (!irq_data || !cfg) { if (!cfg) {
ret = -EINVAL; ret = -EINVAL;
goto out_free_data; goto out_free_data;
} }
......
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