lkml.org 
[lkml]   [2021]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] genirq/msi: Fix a duplicate issue for interrupt sysfs
Date
The function msi_sysfs_populate_desc() has a for-loop with the number of
interrupts, and it is called inside a for-loop with the same interrupts
in __msi_domain_alloc_irqs().

So, msi_sysfs_populate_desc() is called multiple times for the same
descriptor, and a duplicate error for sysfs will occur. It should be
called out of the for-loop.

Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: bf5e758f02fc ("genirq/msi: Simplify sysfs handling")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
kernel/irq/msi.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 173bc04f9fe5..2f1c4ff8c683 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -887,12 +887,12 @@ int __msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
ret = msi_init_virq(domain, virq + i, vflags);
if (ret)
return ret;
+ }

- if (info->flags & MSI_FLAG_DEV_SYSFS) {
- ret = msi_sysfs_populate_desc(dev, desc);
- if (ret)
- return ret;
- }
+ if (info->flags & MSI_FLAG_DEV_SYSFS) {
+ ret = msi_sysfs_populate_desc(dev, desc);
+ if (ret)
+ return ret;
}
allocated++;
}
--
2.7.4
\
 
 \ /
  Last update: 2021-12-27 14:21    [W:0.027 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site