usb: gadget: udc: avoid dereference before NULL check in ep_queue

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]>
This commit is contained in:
John W. Linville 2015-01-06 14:49:47 -05:00 • committed by Greg Kroah-Hartman
commit f26d29e34e

View file

@ -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;