Commit f9da25c7 authored by David Mosberger-Tang's avatar David Mosberger-Tang Committed by Greg Kroah-Hartman

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

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid Mosberger <davidm@egauge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 357d596e
...@@ -588,12 +588,14 @@ max3421_next_transfer(struct usb_hcd *hcd, int fast_retransmit) ...@@ -588,12 +588,14 @@ max3421_next_transfer(struct usb_hcd *hcd, int fast_retransmit)
{ {
struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd);
struct urb *urb = max3421_hcd->curr_urb; struct urb *urb = max3421_hcd->curr_urb;
struct max3421_ep *max3421_ep = urb->ep->hcpriv; struct max3421_ep *max3421_ep;
int cmd = -EINVAL; int cmd = -EINVAL;
if (!urb) if (!urb)
return; /* nothing to do */ return; /* nothing to do */
max3421_ep = urb->ep->hcpriv;
switch (max3421_ep->pkt_state) { switch (max3421_ep->pkt_state) {
case PKT_STATE_SETUP: case PKT_STATE_SETUP:
cmd = max3421_ctrl_setup(hcd, urb); cmd = max3421_ctrl_setup(hcd, urb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment