Skip to content

Commit

Permalink
rtase: Fix a check for error in rtase_alloc_msix()
Browse files Browse the repository at this point in the history
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: a36e9f5 ("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>
  • Loading branch information
Dan Carpenter authored and kuba-moo committed Jan 9, 2025
1 parent 426046e commit 2055272
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/realtek/rtase/rtase_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2055272

Please sign in to comment.