summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/udc
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2015-01-06 19:49:47 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-09 18:01:46 (GMT)
commitf26d29e34e203296140334087fa3c81168626d76 (patch)
treebb8956873c0431459f9fff7535a18ecd34f0dfad /drivers/usb/gadget/udc
parentf56e67f0a880a5b795cdb5f62614aafe264c5304 (diff)
downloadlinux-f26d29e34e203296140334087fa3c81168626d76.tar.xz
usb: gadget: udc: avoid dereference before NULL check in ep_queue
Coverity: CID 1260069 Signed-off-by: John W. Linville <linville@tuxdriver.com> Cc: Felipe Balbi <balbi@ti.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/udc')
-rw-r--r--drivers/usb/gadget/udc/bdc/bdc_ep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.c b/drivers/usb/gadget/udc/bdc/bdc_ep.c
index ff67cea..d4fe8d7 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_ep.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c
@@ -718,10 +718,11 @@ static int ep_queue(struct bdc_ep *ep, struct bdc_req *req)
struct bdc *bdc;
int ret = 0;
- bdc = ep->bdc;
if (!req || !ep || !ep->usb_ep.desc)
return -EINVAL;
+ bdc = ep->bdc;
+
req->usb_req.actual = 0;
req->usb_req.status = -EINPROGRESS;
req->epnum = ep->ep_num;