mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
rtase: Fix a check for error in rtase_alloc_msix()
The pci_irq_vector() function never returns zero. It returns negative
error codes or a positive non-zero IRQ number. Fix the error checking to
test for negatives.
Fixes: a36e9f5cfe ("rtase: Add support for a pci table in this module")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Link: https://patch.msgid.link/f2ecc88d-af13-4651-9820-7cc665230019@stanley.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
426046e2d6
commit
2055272e3a
|
|
@ -1827,7 +1827,7 @@ static int rtase_alloc_msix(struct pci_dev *pdev, struct rtase_private *tp)
|
|||
|
||||
for (i = 0; i < tp->int_nums; i++) {
|
||||
irq = pci_irq_vector(pdev, i);
|
||||
if (!irq) {
|
||||
if (irq < 0) {
|
||||
pci_disable_msix(pdev);
|
||||
return irq;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user