* [PATCH] thunderbolt: Add the missed ida_simple_remove() in ring_request_msix()
@ 2020-10-13 2:45 Jing Xiangfeng
2020-10-13 11:43 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Jing Xiangfeng @ 2020-10-13 2:45 UTC (permalink / raw)
To: andreas.noever, michael.jamet, mika.westerberg, YehezkelShB,
gregkh, andriy.shevchenko
Cc: linux-usb, linux-kernel, jingxiangfeng
ring_request_msix() misses to call ida_simple_remove() in an error path.
Add the missed function call to fix it.
Fixes: 046bee1f9ab8 ("thunderbolt: Add MSI-X support")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
---
drivers/thunderbolt/nhi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index 5f7489fa1327..7732e7a9942f 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -406,8 +406,10 @@ static int ring_request_msix(struct tb_ring *ring, bool no_suspend)
ring->vector = ret;
ring->irq = pci_irq_vector(ring->nhi->pdev, ring->vector);
- if (ring->irq < 0)
+ if (ring->irq < 0) {
+ ida_simple_remove(&nhi->msix_ida, ret);
return ring->irq;
+ }
irqflags = no_suspend ? IRQF_NO_SUSPEND : 0;
return request_irq(ring->irq, ring_msix, irqflags, "thunderbolt", ring);
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] thunderbolt: Add the missed ida_simple_remove() in ring_request_msix()
2020-10-13 2:45 [PATCH] thunderbolt: Add the missed ida_simple_remove() in ring_request_msix() Jing Xiangfeng
@ 2020-10-13 11:43 ` Andy Shevchenko
2020-10-13 12:33 ` Jing Xiangfeng
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2020-10-13 11:43 UTC (permalink / raw)
To: Jing Xiangfeng
Cc: andreas.noever, michael.jamet, mika.westerberg, YehezkelShB,
gregkh, linux-usb, linux-kernel
On Tue, Oct 13, 2020 at 10:45:18AM +0800, Jing Xiangfeng wrote:
> ring_request_msix() misses to call ida_simple_remove() in an error path.
> Add the missed function call to fix it.
...
> ring->irq = pci_irq_vector(ring->nhi->pdev, ring->vector);
> - if (ring->irq < 0)
> + if (ring->irq < 0) {
> + ida_simple_remove(&nhi->msix_ida, ret);
> return ring->irq;
> + }
>
> irqflags = no_suspend ? IRQF_NO_SUSPEND : 0;
> return request_irq(ring->irq, ring_msix, irqflags, "thunderbolt", ring);
According to your logic don't you need it here as well?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] thunderbolt: Add the missed ida_simple_remove() in ring_request_msix()
2020-10-13 11:43 ` Andy Shevchenko
@ 2020-10-13 12:33 ` Jing Xiangfeng
0 siblings, 0 replies; 3+ messages in thread
From: Jing Xiangfeng @ 2020-10-13 12:33 UTC (permalink / raw)
To: Andy Shevchenko
Cc: andreas.noever, michael.jamet, mika.westerberg, YehezkelShB,
gregkh, linux-usb, linux-kernel
On 2020/10/13 19:43, Andy Shevchenko wrote:
> On Tue, Oct 13, 2020 at 10:45:18AM +0800, Jing Xiangfeng wrote:
>> ring_request_msix() misses to call ida_simple_remove() in an error path.
>> Add the missed function call to fix it.
> ...
>
>> ring->irq = pci_irq_vector(ring->nhi->pdev, ring->vector);
>> - if (ring->irq < 0)
>> + if (ring->irq < 0) {
>> + ida_simple_remove(&nhi->msix_ida, ret);
>> return ring->irq;
>> + }
>>
>> irqflags = no_suspend ? IRQF_NO_SUSPEND : 0;
>> return request_irq(ring->irq, ring_msix, irqflags, "thunderbolt", ring);
> According to your logic don't you need it here as well?
Hm indeed. Will fix too.
Thanks for your review.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-10-13 12:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 2:45 [PATCH] thunderbolt: Add the missed ida_simple_remove() in ring_request_msix() Jing Xiangfeng
2020-10-13 11:43 ` Andy Shevchenko
2020-10-13 12:33 ` Jing Xiangfeng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).