OSDN Git Service

dwc3: gadget: Add NULL check against endpoint's desc in set_halt()
authorMayank Rana <mrana@codeaurora.org>
Tue, 28 Apr 2015 17:39:56 +0000 (10:39 -0700)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 18:06:47 +0000 (11:06 -0700)
commit7d2a036a4e375342d673bf9662e56b190cc9dd55
tree37446d6335ffebf1f5ff07e38c3a9b491152f87a
parent710341d1cf193af882e8003115a909867a6d764e
dwc3: gadget: Add NULL check against endpoint's desc in set_halt()

In few instances, dwc3_gadget_ep_set_halt() API is called after USB
endpoint is disabled which results into device crash with NULL pointer
dereference. USB endpoint's descriptors are set to NULL as part of USB
endpoint disable functionality. Hence fix this issue by adding NULL
pointer check against endpoint's descriptor.

CRs-Fixed: 829034
Change-Id: I2e1f67571ed202fab21655bd8f13fc54706419a7
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
drivers/usb/dwc3/gadget.c