Home
last modified time | relevance | path

Searched hist:"2 b5fff1c93bdef7a3c2f9314b3fcfd50eb3712fb" (Results 1 – 1 of 1) sorted by relevance

/rk3399_rockchip-uboot/drivers/usb/gadget/
H A Df_dfu.c2b5fff1c93bdef7a3c2f9314b3fcfd50eb3712fb Fri Jun 28 14:42:02 UTC 2019 Ralph Siemsen <ralph.siemsen@linaro.org> UPSTREAM: usb: gadget: f_dfu.c: fix memory leak

dfu_prepare_function() allocates N+1 descriptor header structures,
the last one being the "DFU Functional Descriptor".

dfu_unbind() handles de-allocation, but fails to free the final
one (eg. "DFU Functional Descriptor"), leading to memory leak.

Fixed by incrementing counter, as in dfu_prepare_function().

Change-Id: I990f3874d6e3dca78036d6f30a05e765fbe38c67
Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit fe876984a428cc0058bdb536ac948397762f3c0d)