From: Jing Xiangfeng <jingxiangfeng@huawei.com>
To: <andreas.noever@gmail.com>, <michael.jamet@intel.com>,
<mika.westerberg@linux.intel.com>, <YehezkelShB@gmail.com>,
<gregkh@linuxfoundation.org>, <andriy.shevchenko@linux.intel.com>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<jingxiangfeng@huawei.com>
Subject: [PATCH] thunderbolt: Add the missed ida_simple_remove() in ring_request_msix()
Date: Tue, 13 Oct 2020 10:45:18 +0800 [thread overview]
Message-ID: <20201013024518.195557-1-jingxiangfeng@huawei.com> (raw)
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
next reply other threads:[~2020-10-13 2:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-13 2:45 Jing Xiangfeng [this message]
2020-10-13 11:43 ` [PATCH] thunderbolt: Add the missed ida_simple_remove() in ring_request_msix() Andy Shevchenko
2020-10-13 12:33 ` Jing Xiangfeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201013024518.195557-1-jingxiangfeng@huawei.com \
--to=jingxiangfeng@huawei.com \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=michael.jamet@intel.com \
--cc=mika.westerberg@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).