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: 128d5874c0
("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>
This commit is contained in:
parent
37d4f55567
commit
a325f174d7
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue