projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
856deb8
)
iommu/amd: Prevent NULL pointer dereference
author
Thomas Gleixner
<tglx@linutronix.de>
Wed, 26 Aug 2020 11:16:29 +0000
(13:16 +0200)
committer
Thomas Gleixner
<tglx@linutronix.de>
Wed, 16 Sep 2020 14:52:25 +0000
(16:52 +0200)
Dereferencing irq_data before checking it for NULL is suboptimal.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/iommu.c
patch
|
blob
|
history
diff --git
a/drivers/iommu/amd/iommu.c
b/drivers/iommu/amd/iommu.c
index
07ae8b9
..
db44ce6
100644
(file)
--- a/
drivers/iommu/amd/iommu.c
+++ b/
drivers/iommu/amd/iommu.c
@@
-3731,8
+3731,8
@@
static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq,
for (i = 0; i < nr_irqs; i++) {
irq_data = irq_domain_get_irq_data(domain, virq + i);
- cfg = irq
d_cfg(irq_data)
;
- if (!
irq_data || !
cfg) {
+ cfg = irq
_data ? irqd_cfg(irq_data) : NULL
;
+ if (!cfg) {
ret = -EINVAL;
goto out_free_data;
}