Skip to content

Commit

Permalink
usb: gadget: udc: avoid dereference before NULL check in ep_queue
Browse files Browse the repository at this point in the history
Coverity: CID 1260069

Signed-off-by: John W. Linville <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
linvjw authored and gregkh committed Jan 9, 2015
1 parent f56e67f commit f26d29e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/gadget/udc/bdc/bdc_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f26d29e

Please sign in to comment.