usb: gadget: f_fs: Fix NULL pointer dereference related crash
Commit dd102bc5 ("USB: gadget: f_fs: Allocate extra buffer for IN endpoint") added functionality to allocate extra buffer with USB IN endpoint for each adb write request. This results into NULL pointer dereference crash while epfile_io() is trying to access ffs->gagdet->extra_buf_alloc against ffs_func_unbind(). ffs_func_unbind() marks ffs->gadget as NULL. Fix this issue by using spin_lock when ffs->gadget is being updated and accessed. CRs-Fixed: 994049 Change-Id: I7ebad4fd2b2c4cc7654336447cd5753891ba4f51 Signed-off-by:Mayank Rana <mrana@codeaurora.org>
Loading
Please register or sign in to comment