Skip to content

Commit a325f17

Browse files
Dan Carpenterdavem330
authored andcommitted
net: ti: icssg-prueth: Fix signedness bug in prueth_init_tx_chns()
The "tx_chn->irq" variable is unsigned so the error checking does not work correctly. Fixes: 128d587 ("net: ti: icssg-prueth: Add ICSSG ethernet driver") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Roger Quadros <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 37d4f55 commit a325f17

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/ethernet/ti/icssg/icssg_prueth.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,14 @@ static int prueth_init_tx_chns(struct prueth_emac *emac)
316316
goto fail;
317317
}
318318

319-
tx_chn->irq = k3_udma_glue_tx_get_irq(tx_chn->tx_chn);
320-
if (tx_chn->irq <= 0) {
321-
ret = -EINVAL;
319+
ret = k3_udma_glue_tx_get_irq(tx_chn->tx_chn);
320+
if (ret <= 0) {
321+
if (!ret)
322+
ret = -EINVAL;
322323
netdev_err(ndev, "failed to get tx irq\n");
323324
goto fail;
324325
}
326+
tx_chn->irq = ret;
325327

326328
snprintf(tx_chn->name, sizeof(tx_chn->name), "%s-tx%d",
327329
dev_name(dev), tx_chn->id);

0 commit comments

Comments
 (0)