usb: gadget: f_midi: Fix use after free bug
Upon cable disconnect usb composition switches from midi
to default composition as a result midi function driver
frees the midi function. When cable is plugged back in
android_setup calls function setup call back for all the
function instances having non-null function pointer. This
results into access to already freed function pointer
stored in function instance. Fix this issue by setting
function instance's function pointer to NULL so that
android_setup will skip calling midi function setup upon
next cable connect.
Change-Id: Ia619650c94c35aea015a89841c59a1f9dbc521f9
Signed-off-by:
Hemant Kumar <hemantk@codeaurora.org>
Loading
Please register or sign in to comment