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 13:01:46 -0500 |
commit | f26d29e34e203296140334087fa3c81168626d76 (patch) | |
tree | bb8956873c0431459f9fff7535a18ecd34f0dfad /drivers | |
parent | f56e67f0a880a5b795cdb5f62614aafe264c5304 (diff) |
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')
-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 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) | |||
718 | struct bdc *bdc; | 718 | struct bdc *bdc; |
719 | int ret = 0; | 719 | int ret = 0; |
720 | 720 | ||
721 | bdc = ep->bdc; | ||
722 | if (!req || !ep || !ep->usb_ep.desc) | 721 | if (!req || !ep || !ep->usb_ep.desc) |
723 | return -EINVAL; | 722 | return -EINVAL; |
724 | 723 | ||
724 | bdc = ep->bdc; | ||
725 | |||
725 | req->usb_req.actual = 0; | 726 | req->usb_req.actual = 0; |
726 | req->usb_req.status = -EINPROGRESS; | 727 | req->usb_req.status = -EINPROGRESS; |
727 | req->epnum = ep->ep_num; | 728 | req->epnum = ep->ep_num; |