Skip to content
Commit fe876984 authored by Ralph Siemsen's avatar Ralph Siemsen Committed by Marek Vasut
Browse files

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().

Signed-off-by: default avatarRalph Siemsen <ralph.siemsen@linaro.org>
parent ed3a37a2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment