Commit a325f174 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

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: 128d5874 ("net: ti: icssg-prueth: Add ICSSG ethernet driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarRoger Quadros <rogerq@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 37d4f555
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment