提交 2ce4fd5a 编写于 作者: C Colin Ian King 提交者: Marc Kleine-Budde

can: etas_es58x: Fix missing null check on netdev pointer

There is an assignment to *netdev that is that can potentially be null
but the null check is checking netdev and not *netdev as intended. Fix
this by adding in the missing * operator.

Fixes: 85372578 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")
Link: https://lore.kernel.org/r/20210415084723.1807935-1-colin.king@canonical.com
Addresses-Coverity: ("Dereference before null check")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Acked-by: NVincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
上级 b2f0ca00
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册