diff options
author | John W. Linville <linville@tuxdriver.com> | 2015-01-06 14:49:47 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-09 10:01:46 -0800 |
commit | f26d29e34e203296140334087fa3c81168626d76 (patch) | |
tree | bb8956873c0431459f9fff7535a18ecd34f0dfad /drivers/usb | |
parent | f56e67f0a880a5b795cdb5f62614aafe264c5304 (diff) | |
download | op-kernel-dev-f26d29e34e203296140334087fa3c81168626d76.zip op-kernel-dev-f26d29e34e203296140334087fa3c81168626d76.tar.gz |
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')
-rw-r--r-- | drivers/usb/gadget/udc/bdc/bdc_ep.c | 3 |
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; |