net: Fix checks on unsigned in w90p910_ether_probe()
Subsystems (2)
PATCH 1/1 net: Fix checks on unsigned in w90p910_ether_probe()
ether->txirq and ->rxirq are unsigned
---
drivers/net/arm/w90p910_ether.c +9 -7
@@ -981,7 +981,7 @@ static int __devinit w90p910_ether_probe(struct platform_device *pdev) {struct w90p910_ether *ether;struct net_device *dev; -int error; +int error, ret; dev =alloc_etherdev (sizeof (struct w90p910_ether ));if (!dev)
@@ -1010,17 +1010,19 @@ static int __devinit w90p910_ether_probe(struct platform_device *pdev) goto failed_free_mem; } - ether->txirq =platform_get_irq (pdev,0 ); -if (ether->txirq <0 ) { + ret =platform_get_irq (pdev,0 ); + ether->txirq = ret; +if (ret <0 ) {dev_err (&pdev->dev,"failed to get ether tx irq\n" ); - error = -ENXIO ; + error = ret; goto failed_free_io; } - ether->rxirq =platform_get_irq (pdev,1 ); -if (ether->rxirq <0 ) { + ret =platform_get_irq (pdev,1 ); + ether->rxirq = ret; +if (ret <0 ) {dev_err (&pdev->dev,"failed to get ether rx irq\n" ); - error = -ENXIO ; + error = ret; goto failed_free_txirq; }
David Miller
maintainerFrom: Roel Kluin <[email protected]>
Date: Tue, 20 Oct 2009 20:14:36 +0200
Quoted 3 lines
ether->txirqand ->rxirq are unsignedSigned-off-by Roel Kluin <[email protected]>
platform_get_irq() returns a signed int so the intention is more likely that catching negative value returns was intended.
Probably the correct fix is to mark txirq and rxirq as plain 'int'.
Dear sirs,
Okay, it is right, thanks all for your help.
I will re-fix it later.
2009/10/30, David Miller <[email protected]>:
Quoted 14 lines
From: Roel Kluin <[email protected]>
Date: Tue, 20 Oct 2009 20:14:36 +0200Quoted 3 lines
ether->txirqand ->rxirq are unsignedSigned-off-by Roel Kluin <[email protected]>
platform_get_irq()returns a signed int so the intention is more likely that catching negative value returns was intended.Probably the correct fix is to mark txirq and rxirq as plain 'int'.
Signature · 1 line
Wan z.s