Commit dd8bb803 authored by Jiapeng Chong's avatar Jiapeng Chong Committed by Marc Kleine-Budde

can: raw: Remove NULL check before dev_{put, hold}

The call netdev_{put, hold} of dev_{put, hold} will check NULL, so there
is no need to check before using dev_{put, hold}, remove it to silence
the warning:

./net/can/raw.c:497:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed.
Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6231Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reported-by: default avatarSimon Horman <horms@kernel.org>
Acked-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20230825064656.87751-1-jiapeng.chong@linux.alibaba.comSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 2806d74d
......@@ -493,8 +493,7 @@ static int raw_bind(struct socket *sock, struct sockaddr *uaddr, int len)
out_put_dev:
/* remove potential reference from dev_get_by_index() */
if (dev)
dev_put(dev);
dev_put(dev);
out:
release_sock(sk);
rtnl_unlock();
......
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