Re: [PATCH] can: mcba_usb: fix potential resource leak in mcba_usb_xmit_cmd()
From: Marc Kleine-Budde
Date: Thu Nov 24 2022 - 09:45:57 EST
On 20.11.2022 18:14:14, Jianglei Nie wrote:
> mcba_usb_xmit_cmd() gets free ctx by mcba_usb_get_free_ctx(). When
> mcba_usb_xmit() fails, the ctx should be freed with mcba_usb_free_ctx()
> like mcba_usb_start_xmit() does in label "xmit_failed" to avoid potential
> resource leak.
>
> Fix it by calling mcba_usb_free_ctx() when mcba_usb_xmit() fails.
>
> Signed-off-by: Jianglei Nie <niejianglei2021@xxxxxxx>
Applied to linux-can.
Thanks,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Attachment:
signature.asc
Description: PGP signature