diff options
author | David Mosberger-Tang <davidm@egauge.net> | 2014-05-28 12:06:24 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-28 16:24:07 -0400 |
commit | f9da25c798ae7d89a25918cc897c17abb1490e13 (patch) | |
tree | 7e7e3f508784a3953334c87ad5f127c8b69b35ff /drivers/usb/host | |
parent | 357d596ea7bea5abf1479cc72ae5888c738717dd (diff) |
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>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/max3421-hcd.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) | |||
588 | { | 588 | { |
589 | struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); | 589 | struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); |
590 | struct urb *urb = max3421_hcd->curr_urb; | 590 | struct urb *urb = max3421_hcd->curr_urb; |
591 | struct max3421_ep *max3421_ep = urb->ep->hcpriv; | 591 | struct max3421_ep *max3421_ep; |
592 | int cmd = -EINVAL; | 592 | int cmd = -EINVAL; |
593 | 593 | ||
594 | if (!urb) | 594 | if (!urb) |
595 | return; /* nothing to do */ | 595 | return; /* nothing to do */ |
596 | 596 | ||
597 | max3421_ep = urb->ep->hcpriv; | ||
598 | |||
597 | switch (max3421_ep->pkt_state) { | 599 | switch (max3421_ep->pkt_state) { |
598 | case PKT_STATE_SETUP: | 600 | case PKT_STATE_SETUP: |
599 | cmd = max3421_ctrl_setup(hcd, urb); | 601 | cmd = max3421_ctrl_setup(hcd, urb); |