summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/udc/bdc/bdc_ep.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2015-01-06 22:49:47 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-09 21:01:46 +0300
commitf26d29e34e203296140334087fa3c81168626d76 (patch)
treebb8956873c0431459f9fff7535a18ecd34f0dfad /drivers/usb/gadget/udc/bdc/bdc_ep.c
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/bdc/bdc_ep.c')
-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 ff67ceac77c4..d4fe8d769bd6 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;