Skip to content

Commit

Permalink
net: ti: icssg-prueth: Fix signedness bug in prueth_init_tx_chns()
Browse files Browse the repository at this point in the history
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 <dan.carpenter@linaro.org>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Oct 4, 2023
1 parent 37d4f55 commit a325f17
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/ethernet/ti/icssg/icssg_prueth.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,14 @@ static int prueth_init_tx_chns(struct prueth_emac *emac)
goto fail;
}

tx_chn->irq = k3_udma_glue_tx_get_irq(tx_chn->tx_chn);
if (tx_chn->irq <= 0) {
ret = -EINVAL;
ret = k3_udma_glue_tx_get_irq(tx_chn->tx_chn);
if (ret <= 0) {
if (!ret)
ret = -EINVAL;
netdev_err(ndev, "failed to get tx irq\n");
goto fail;
}
tx_chn->irq = ret;

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

0 comments on commit a325f17

Please sign in to comment.