Commit 13a84cf3 authored by Zhang Qilong's avatar Zhang Qilong Committed by Marc Kleine-Budde

can: kvaser_pciefd: kvaser_pciefd_open(): fix error handling

If kvaser_pciefd_bus_on() failed, we should call close_candev() to avoid
reference leak.

Fixes: 26ad340e ("can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices")
Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20201128133922.3276973-3-zhangqilong3@huawei.comSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 44cef0c0
......@@ -692,8 +692,10 @@ static int kvaser_pciefd_open(struct net_device *netdev)
return err;
err = kvaser_pciefd_bus_on(can);
if (err)
if (err) {
close_candev(netdev);
return err;
}
return 0;
}
......
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