From: David Mosberger-Tang Date: Wed, 28 May 2014 16:06:24 +0000 (-0600) Subject: usb: host: max3421-hcd: Fix potential NULL urb dereference X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f9da25c798ae7d89a25918cc897c17abb1490e13;p=linux-beck.git usb: host: max3421-hcd: Fix potential NULL urb dereference Reported-by: Dan Carpenter Signed-off-by: David Mosberger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c index dfc74d6738db..28abda14c5e2 100644 --- a/drivers/usb/host/max3421-hcd.c +++ b/drivers/usb/host/max3421-hcd.c @@ -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);