linux-xiaomi-chiron/drivers/net/can/usb/etas_es58x
Vincent Mailhol d9447f768b can: etas_es58x: es58x_rx_err_msg(): fix memory leak in error path
In es58x_rx_err_msg(), if can->do_set_mode() fails, the function
directly returns without calling netif_rx(skb). This means that the
skb previously allocated by alloc_can_err_skb() is not freed. In other
terms, this is a memory leak.

This patch simply removes the return statement in the error branch and
let the function continue.

Issue was found with GCC -fanalyzer, please follow the link below for
details.

Fixes: 8537257874 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")
Link: https://lore.kernel.org/all/20211026180740.1953265-1-mailhol.vincent@wanadoo.fr
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-11-06 17:29:40 +01:00
..
es58x_core.c can: etas_es58x: es58x_rx_err_msg(): fix memory leak in error path 2021-11-06 17:29:40 +01:00
es58x_core.h can: etas_es58x: fix three typos in author name and documentation 2021-07-25 11:36:28 +02:00
es58x_fd.c can: bittiming: allow TDC{V,O} to be zero and add can_tdc_const::tdc{v,o,f}_min 2021-10-24 16:24:28 +02:00
es58x_fd.h treewide: Replace open-coded flex arrays in unions 2021-10-18 12:28:53 -07:00
es581_4.c can: etas_es58x: rewrite the message cast in es58{1,_fd}_tx_can_msg to increase readability 2021-07-25 11:36:28 +02:00
es581_4.h treewide: Replace open-coded flex arrays in unions 2021-10-18 12:28:53 -07:00
Makefile can: etas_es58x: add support for the ETAS ES58X_FD CAN USB interfaces 2021-04-13 10:15:43 +02:00