usb: gadget: mtp: Fix possible NULL pointer dereference
If the vfs_write fails for the possible last request,
then there is no request queued to the controller and
read_req is NULL. And usb_ep_dequeue will result in a
NULL pointer dereference. Fix this by validating the
read_req before usb_ep_dequeue.
Change-Id: I9ddb3783ec1a56a59da72ff73283b8c3cafac056
Signed-off-by:
Sriharsha Allenki <sallenki@codeaurora.org>
Loading
Please register or sign in to comment