[PATCH] usb: host: max3421-hcd: Fix potential NULL urb dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: David Mosberger-Tang <davidm@xxxxxxxxxx>

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: David Mosberger <davidm@xxxxxxxxxx>
---
 drivers/usb/host/max3421-hcd.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
index dfc74d6..28abda1 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);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux