brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014
[openwrt/svn-archive/archive.git] / target / linux / brcm2708 / patches-3.10 / 0050-dwc_otg-Fix-incorrect-URB-allocation-error-handling.patch
1 From 65eba02bb428a4c572b5d3109e939a5e84a54747 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/196] dwc_otg: Fix incorrect URB allocation error handling
5
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.
9 ---
10 drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 16 ++++++----------
11 1 file changed, 6 insertions(+), 10 deletions(-)
12
13 diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
14 index e653d84..fcec97f 100644
15 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
16 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
17 @@ -3136,17 +3136,13 @@ dwc_otg_hcd_urb_t *dwc_otg_hcd_urb_alloc(dwc_otg_hcd_t * hcd,
18 else
19 dwc_otg_urb = DWC_ALLOC(size);
20
21 - if (NULL != dwc_otg_urb)
22 - dwc_otg_urb->packet_count = iso_desc_count;
23 + if (dwc_otg_urb)
24 + dwc_otg_urb->packet_count = iso_desc_count;
25 else {
26 - dwc_otg_urb->packet_count = 0;
27 - if (size != 0) {
28 - DWC_ERROR("**** DWC OTG HCD URB alloc - "
29 - "%salloc of %db failed\n",
30 - atomic_alloc?"atomic ":"", size);
31 - }
32 - }
33 -
34 + DWC_ERROR("**** DWC OTG HCD URB alloc - "
35 + "%salloc of %db failed\n",
36 + atomic_alloc?"atomic ":"", size);
37 + }
38 return dwc_otg_urb;
39 }
40
41 --
42 1.9.1
43