Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 128d5874c082 ("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>

authored by

Dan Carpenter and committed by
David S. Miller
a325f174 37d4f555

+5 -3
+5 -3
drivers/net/ethernet/ti/icssg/icssg_prueth.c
··· 316 316 goto fail; 317 317 } 318 318 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; 322 323 netdev_err(ndev, "failed to get tx irq\n"); 323 324 goto fail; 324 325 } 326 + tx_chn->irq = ret; 325 327 326 328 snprintf(tx_chn->name, sizeof(tx_chn->name), "%s-tx%d", 327 329 dev_name(dev), tx_chn->id);