can: etas_es58x: Fix missing null check on netdev pointer
Subsystems (5)
PATCH 1/1 can: etas_es58x: Fix missing null check on netdev pointer
From: Colin Ian King <[email protected]>
There is an assignment to *netdev that is can potentially be null but the null check is checking netdev and not *netdev as intended. Fix this by adding in the missing * operator.
Addresses-Coverity: ("Dereference before null check")
--- drivers/net/can/usb/etas_es58x/es58x_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/usb/etas_es58x/es58x_core.h +1 -1
@@ -625,7 +625,7 @@ static inline int es58x_get_netdev(struct es58x_device *es58x_dev,return -ECHRNG ; *netdev = es58x_dev->netdev[channel_idx]; -if (!netdev || !netif_device_present (*netdev)) +if (!*netdev || !netif_device_present (*netdev))return -ENODEV ;return 0 ;
Signature · 1 line
2.30.2
Marc Kleine-Budde
maintainerQuoted 9 lines · Colin King
From: Colin Ian King <[email protected]>
There is an assignment to *netdev that is can potentially be null but the null check is checking netdev and not *netdev as intended. Fix this by adding in the missing * operator.
Addresses-Coverity: ("Dereference before null check")
Fixes 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")Signed-off-by Colin Ian King <[email protected]>
Looks good. Applied to linux-can-next/testing.
Tnx,
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Vincent MAILHOL
Acked-byQuoted 4 lines · Marc Kleine-Budde
Quoted 3 lines · Colin King
From: Colin Ian King <[email protected]>
There is an assignment to *netdev that is can potentially be null but the
^^
Typo: that is can -> that can
Quoted 6 lines
Quoted 6 lines
null check is checking netdev and not *netdev as intended. Fix this by adding in the missing * operator.
Addresses-Coverity: ("Dereference before null check")
Fixes 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")Signed-off-by Colin Ian King <[email protected]>
Thanks Colin!
Marc Kleine-Budde
maintainerQuoted 7 lines · Vincent MAILHOL
Quoted 4 lines · Marc Kleine-Budde
Quoted 3 lines · Colin King
From: Colin Ian King <[email protected]>
There is an assignment to *netdev that is can potentially be null but the
^^Typo: that is can -> that can
Fixed.
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
null check is checking netdev and not *netdev as intended. Fix this by adding in the missing * operator.
Addresses-Coverity: ("Dereference before null check")
Fixes 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")Signed-off-by Colin Ian King <[email protected]>Acked-by Vincent Mailhol <[email protected]>
Added to the patch.
Tnx,
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |