1 From e3e9b6dbd5507ea5e571acae3ef6ed2e2d5dadcf Mon Sep 17 00:00:00 2001
2 From: P33M <P33M@github.com>
3 Date: Fri, 15 Feb 2013 22:38:40 +0000
4 Subject: [PATCH 050/174] dwc_otg: Fix incorrect URB allocation error handling
6 If the memory allocation for a dwc_otg_urb failed, the kernel would OOPS
7 because for some reason a member of the *unallocated* struct was set to
8 zero. Error handling changed to fail correctly.
10 drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 16 ++++++----------
11 1 file changed, 6 insertions(+), 10 deletions(-)
13 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
14 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
15 @@ -3136,17 +3136,13 @@ dwc_otg_hcd_urb_t *dwc_otg_hcd_urb_alloc
17 dwc_otg_urb = DWC_ALLOC(size);
19 - if (NULL != dwc_otg_urb)
20 - dwc_otg_urb->packet_count = iso_desc_count;
22 + dwc_otg_urb->packet_count = iso_desc_count;
24 - dwc_otg_urb->packet_count = 0;
26 - DWC_ERROR("**** DWC OTG HCD URB alloc - "
27 - "%salloc of %db failed\n",
28 - atomic_alloc?"atomic ":"", size);
32 + DWC_ERROR("**** DWC OTG HCD URB alloc - "
33 + "%salloc of %db failed\n",
34 + atomic_alloc?"atomic ":"", size);