mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 21:16:02 +07:00
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: 26ad340e58
("can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20201128133922.3276973-3-zhangqilong3@huawei.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
44cef0c0ff
commit
13a84cf37a
@ -692,8 +692,10 @@ static int kvaser_pciefd_open(struct net_device *netdev)
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
err = kvaser_pciefd_bus_on(can);
|
err = kvaser_pciefd_bus_on(can);
|
||||||
if (err)
|
if (err) {
|
||||||
|
close_candev(netdev);
|
||||||
return err;
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user