ANDROID: usb: gadget: fix NULL pointer issue in mtp_read()
authorJiebing Li <jiebing.li@intel.com>
Tue, 10 Mar 2015 03:25:50 +0000 (11:25 +0800)
committerAmit Pundir <amit.pundir@linaro.org>
Thu, 25 May 2017 11:07:25 +0000 (16:37 +0530)
commit4966fb00ef5226cee28c0fb768fed7f5707be158
tree5c41ee0bef695382bc444febc0636f8c8ab5b4a3
parent8bb6e5139ebe6a37df26911a54ae7e5a27ad1615
ANDROID: usb: gadget: fix NULL pointer issue in mtp_read()

pointer dev->ep_out->desc is set to NULL if MTP function
is disabled during read operation. So we need to do pointer check
before access it and add spin lock protection in case it's modified
at another place in future.

Patchset: mtp

Change-Id: I96d3d685e93276c9065a1aa7b0cbbdc2e159aa6f
Signed-off-by: Jiebing Li <jiebing.li@intel.com>
Signed-off-by: Wang, Yu <yu.y.wang@intel.com>
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
drivers/usb/gadget/function/f_mtp.c