]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: f_tcm: Fix some resource leaks in some error paths
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 14 Aug 2020 05:55:01 +0000 (07:55 +0200)
committerFelipe Balbi <balbi@kernel.org>
Mon, 17 Aug 2020 10:35:22 +0000 (13:35 +0300)
commitcab062b48e892d5fa07b32e5453e340a2462e6d4
treedee3d3cc90f583f43694a7cf91f7227acfeb0c57
parente5f0bf958198ed018c9fdf06e8d307ced9af9c95
usb: gadget: f_tcm: Fix some resource leaks in some error paths

If a memory allocation fails within a 'usb_ep_alloc_request()' call, the
already allocated memory must be released.

Fix a mix-up in the code and free the correct requests.

Fixes: eec629eacd54 ("usb-gadget: Initial merge of target module for UASP + BOT")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/gadget/function/f_tcm.c