can: af_can: Fix error path of can_init()
authorYueHaibing <yuehaibing@huawei.com>
Thu, 16 May 2019 14:36:26 +0000 (22:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Jul 2019 07:04:22 +0000 (09:04 +0200)
commit7f0359b6bf37a8d13ada0a6db93e54196eb4e08f
tree2ae02663487b543dfcdb663329b645dd51e14a81
parente086121ec28d44c7be58fbc112d67dc1b56313ee
can: af_can: Fix error path of can_init()

[ Upstream commit c5a3aed1cd3152429348ee1fe5cdcca65fe901ce ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/can/af_can.c