~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to debian/patches/bugfix/all/rtl8192su-Clean-up-in-case-of-an-error-in-mo.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Ben Hutchings <ben@decadent.org.uk>
2
 
Date: Tue, 25 May 2010 04:20:30 +0100
3
 
Subject: [PATCH] Staging: rtl8192su: Clean up in case of an error in module initialisation
4
 
 
5
 
commit 9a3dfa0555130952517b9a9c3918729495aa709a upstream.
6
 
 
7
 
Currently various resources may be leaked in case of an error.
8
 
 
9
 
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
10
 
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
11
 
---
12
 
 drivers/staging/rtl8192su/r8192U_core.c |   43 ++++++++++++++++++++++++++-----
13
 
 1 files changed, 36 insertions(+), 7 deletions(-)
14
 
 
15
 
diff --git a/drivers/staging/rtl8192su/r8192U_core.c b/drivers/staging/rtl8192su/r8192U_core.c
16
 
index 447d647..1b4ff90 100644
17
 
--- a/drivers/staging/rtl8192su/r8192U_core.c
18
 
+++ b/drivers/staging/rtl8192su/r8192U_core.c
19
 
@@ -990,10 +990,11 @@ static int proc_get_stats_rx(char *page, char **start,
20
 
        return len;
21
 
 }
22
 
 
23
 
-void rtl8192_proc_module_init(void)
24
 
+int rtl8192_proc_module_init(void)
25
 
 {
26
 
        RT_TRACE(COMP_INIT, "Initializing proc filesystem");
27
 
        rtl8192_proc=create_proc_entry(RTL819xU_MODULE_NAME, S_IFDIR, init_net.proc_net);
28
 
+       return rtl8192_proc ? 0 : -ENOMEM;
29
 
 }
30
 
 
31
 
 
32
 
@@ -7473,35 +7474,63 @@ static int __init rtl8192_usb_module_init(void)
33
 
        ret = ieee80211_crypto_init();
34
 
        if (ret) {
35
 
                printk(KERN_ERR "ieee80211_crypto_init() failed %d\n", ret);
36
 
-               return ret;
37
 
+               goto fail_crypto;
38
 
        }
39
 
 
40
 
        ret = ieee80211_crypto_tkip_init();
41
 
        if (ret) {
42
 
                printk(KERN_ERR "ieee80211_crypto_tkip_init() failed %d\n",
43
 
                        ret);
44
 
-               return ret;
45
 
+               goto fail_crypto_tkip;
46
 
        }
47
 
 
48
 
        ret = ieee80211_crypto_ccmp_init();
49
 
        if (ret) {
50
 
                printk(KERN_ERR "ieee80211_crypto_ccmp_init() failed %d\n",
51
 
                        ret);
52
 
-               return ret;
53
 
+               goto fail_crypto_ccmp;
54
 
        }
55
 
 
56
 
        ret = ieee80211_crypto_wep_init();
57
 
        if (ret) {
58
 
                printk(KERN_ERR "ieee80211_crypto_wep_init() failed %d\n", ret);
59
 
-               return ret;
60
 
+               goto fail_crypto_wep;
61
 
        }
62
 
 
63
 
        printk(KERN_INFO "\nLinux kernel driver for RTL8192 based WLAN cards\n");
64
 
        printk(KERN_INFO "Copyright (c) 2007-2008, Realsil Wlan\n");
65
 
        RT_TRACE(COMP_INIT, "Initializing module");
66
 
        RT_TRACE(COMP_INIT, "Wireless extensions version %d", WIRELESS_EXT);
67
 
-       rtl8192_proc_module_init();
68
 
-       return usb_register(&rtl8192_usb_driver);
69
 
+
70
 
+       ret = rtl8192_proc_module_init();
71
 
+       if (ret) {
72
 
+               pr_err("rtl8192_proc_module_init() failed %d\n", ret);
73
 
+               goto fail_proc;
74
 
+       }
75
 
+
76
 
+       ret = usb_register(&rtl8192_usb_driver);
77
 
+       if (ret) {
78
 
+               pr_err("usb_register() failed %d\n", ret);
79
 
+               goto fail_usb;
80
 
+       }
81
 
+
82
 
+       return 0;
83
 
+
84
 
+fail_usb:
85
 
+       rtl8192_proc_module_remove();
86
 
+fail_proc:
87
 
+       ieee80211_crypto_wep_exit();
88
 
+fail_crypto_wep:
89
 
+       ieee80211_crypto_ccmp_exit();
90
 
+fail_crypto_ccmp:
91
 
+       ieee80211_crypto_tkip_exit();
92
 
+fail_crypto_tkip:
93
 
+       ieee80211_crypto_deinit();
94
 
+fail_crypto:
95
 
+#ifdef CONFIG_IEEE80211_DEBUG
96
 
+       ieee80211_debug_exit();
97
 
+#endif
98
 
+       return ret;
99
 
 }
100
 
 
101
 
 
102
 
1.7.1
103