can: af_can: Fix error path of can_init()
authorYueHaibing <yuehaibing@huawei.com>
Thu, 16 May 2019 14:36:26 +0000 (22:36 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 7 Jun 2019 21:03:54 +0000 (23:03 +0200)
commitc5a3aed1cd3152429348ee1fe5cdcca65fe901ce
tree1dd7236f7e6f58f2629e084d159cfb1c0d128443
parent3e82f2f34c930a2a0a9e69fdc2de2f2f1388b442
can: af_can: Fix error path of can_init()

This patch add error path for can_init() to avoid possible crash if some
error occurs.

Fixes: 0d66548a10cb ("[CAN]: Add PF_CAN core module")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/af_can.c