diff options
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-2.6.39/mfd/0002-mfd-Fix-omap_usbhs_alloc_children-error-handling.patch')
-rw-r--r-- | extras/recipes-kernel/linux/linux-omap-2.6.39/mfd/0002-mfd-Fix-omap_usbhs_alloc_children-error-handling.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-2.6.39/mfd/0002-mfd-Fix-omap_usbhs_alloc_children-error-handling.patch b/extras/recipes-kernel/linux/linux-omap-2.6.39/mfd/0002-mfd-Fix-omap_usbhs_alloc_children-error-handling.patch new file mode 100644 index 00000000..380dd82a --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-2.6.39/mfd/0002-mfd-Fix-omap_usbhs_alloc_children-error-handling.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 89a903aca8fda3dcf1a6f9a424247e772afdd44e Mon Sep 17 00:00:00 2001 | ||
2 | From: Axel Lin <axel.lin@gmail.com> | ||
3 | Date: Sat, 14 May 2011 14:15:36 +0800 | ||
4 | Subject: [PATCH 02/13] mfd: Fix omap_usbhs_alloc_children error handling | ||
5 | |||
6 | 1. Return proper error if omap_usbhs_alloc_child fails | ||
7 | 2. In the case of goto err_ehci, we should call platform_device_unregister(ehci) | ||
8 | instead of platform_device_put(ehci) because we have already added the | ||
9 | platform device to device hierarchy. | ||
10 | |||
11 | Signed-off-by: Axel Lin <axel.lin@gmail.com> | ||
12 | Signed-off-by: Axel Lin <axel.lin@gmail.com> | ||
13 | Tested-by: Keshava Munegowda <keshava_mgowda@ti.com> | ||
14 | Acked-by: Felipe Balbi <balbi@ti.com> | ||
15 | Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> | ||
16 | --- | ||
17 | drivers/mfd/omap-usb-host.c | 4 +++- | ||
18 | 1 files changed, 3 insertions(+), 1 deletions(-) | ||
19 | |||
20 | diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c | ||
21 | index 55c5d47..1717144 100644 | ||
22 | --- a/drivers/mfd/omap-usb-host.c | ||
23 | +++ b/drivers/mfd/omap-usb-host.c | ||
24 | @@ -281,6 +281,7 @@ static int omap_usbhs_alloc_children(struct platform_device *pdev) | ||
25 | |||
26 | if (!ehci) { | ||
27 | dev_err(dev, "omap_usbhs_alloc_child failed\n"); | ||
28 | + ret = -ENOMEM; | ||
29 | goto err_end; | ||
30 | } | ||
31 | |||
32 | @@ -304,13 +305,14 @@ static int omap_usbhs_alloc_children(struct platform_device *pdev) | ||
33 | sizeof(*ohci_data), dev); | ||
34 | if (!ohci) { | ||
35 | dev_err(dev, "omap_usbhs_alloc_child failed\n"); | ||
36 | + ret = -ENOMEM; | ||
37 | goto err_ehci; | ||
38 | } | ||
39 | |||
40 | return 0; | ||
41 | |||
42 | err_ehci: | ||
43 | - platform_device_put(ehci); | ||
44 | + platform_device_unregister(ehci); | ||
45 | |||
46 | err_end: | ||
47 | return ret; | ||
48 | -- | ||
49 | 1.6.6.1 | ||
50 | |||