usb: host: max3421-hcd: Fix potential NULL urb dereference

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Mosberger <davidm@egauge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
David Mosberger-Tang 2014-05-28 10:06:24 -06:00 committed by Greg Kroah-Hartman
parent 357d596ea7
commit f9da25c798
1 changed files with 3 additions and 1 deletions

View File

@ -588,12 +588,14 @@ max3421_next_transfer(struct usb_hcd *hcd, int fast_retransmit)
{
struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd);
struct urb *urb = max3421_hcd->curr_urb;
struct max3421_ep *max3421_ep = urb->ep->hcpriv;
struct max3421_ep *max3421_ep;
int cmd = -EINVAL;
if (!urb)
return; /* nothing to do */
max3421_ep = urb->ep->hcpriv;
switch (max3421_ep->pkt_state) {
case PKT_STATE_SETUP:
cmd = max3421_ctrl_setup(hcd, urb);