net: can: etas_es58x: full cleanup in the error case
Subsystems (2)
PATCH 1/1 net: can: etas_es58x: full cleanup in the error case
Memory allocation can fail in the middle. Hence the cleanup needs to be called in every case.
Signed-off-by Oliver Neukum <[email protected]>
--- drivers/net/can/usb/etas_es58x/es58x_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/can/usb/etas_es58x/es58x_core.c +2 -1
@@ -1783,8 +1783,9 @@ static int es58x_open(struct net_device *netdev)if (!es58x_dev->opened_channel_cnt) { ret =es58x_alloc_rx_urbs (es58x_dev); +/* can fail partially */ if (ret) -return ret; + goto free_urbs; ret =es58x_set_realtime_diff_ns (es58x_dev);if (ret)
Signature · 1 line
2.52.0
Vincent Mailhol
maintainerQuoted 4 lines · Oliver Neukum
Memory allocation can fail in the middle. Hence the cleanup needs to be called in every case.
Signed-off-by Oliver Neukum <[email protected]>
Have you seen this:
commit b1979778e985 ("can: etas_es58x: allow partial RX URB
allocation to succeed")
?