This is a note to let you know that I've just added the patch titled

    Staging: rtl8192su: Clean up in case of an error in module initialisation

to the 2.6.32-longterm tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.32.git;a=summary

The filename of the patch is:
     staging-rtl8192su-clean-up-in-case-of-an-error-in-mo.patch
and it can be found in the queue-2.6.32 subdirectory.

If you, or anyone else, feels it should not be added to the 2.6.32 longterm 
tree,
please let <[email protected]> know about it.


>From ff5dfc9b9a174f60290ac5712546ab3b673243ab Mon Sep 17 00:00:00 2001
From: Ben Hutchings <[email protected]>
Date: Tue, 25 May 2010 04:20:30 +0100
Subject: Staging: rtl8192su: Clean up in case of an error in module 
initialisation

From: Ben Hutchings <[email protected]>

commit 9a3dfa0555130952517b9a9c3918729495aa709a upstream.

Currently various resources may be leaked in case of an error.

Signed-off-by: Ben Hutchings <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/rtl8192su/r8192U_core.c |   43 ++++++++++++++++++++++++++------
 1 file changed, 36 insertions(+), 7 deletions(-)

--- a/drivers/staging/rtl8192su/r8192U_core.c
+++ b/drivers/staging/rtl8192su/r8192U_core.c
@@ -959,10 +959,11 @@ static int proc_get_stats_rx(char *page,
        return len;
 }
 
-void rtl8192_proc_module_init(void)
+int rtl8192_proc_module_init(void)
 {
        RT_TRACE(COMP_INIT, "Initializing proc filesystem");
        rtl8192_proc=create_proc_entry(RTL819xU_MODULE_NAME, S_IFDIR, 
init_net.proc_net);
+       return rtl8192_proc ? 0 : -ENOMEM;
 }
 
 
@@ -7564,35 +7565,63 @@ static int __init rtl8192_usb_module_ini
        ret = ieee80211_crypto_init();
        if (ret) {
                printk(KERN_ERR "ieee80211_crypto_init() failed %d\n", ret);
-               return ret;
+               goto fail_crypto;
        }
 
        ret = ieee80211_crypto_tkip_init();
        if (ret) {
                printk(KERN_ERR "ieee80211_crypto_tkip_init() failed %d\n",
                        ret);
-               return ret;
+               goto fail_crypto_tkip;
        }
 
        ret = ieee80211_crypto_ccmp_init();
        if (ret) {
                printk(KERN_ERR "ieee80211_crypto_ccmp_init() failed %d\n",
                        ret);
-               return ret;
+               goto fail_crypto_ccmp;
        }
 
        ret = ieee80211_crypto_wep_init();
        if (ret) {
                printk(KERN_ERR "ieee80211_crypto_wep_init() failed %d\n", ret);
-               return ret;
+               goto fail_crypto_wep;
        }
 
        printk(KERN_INFO "\nLinux kernel driver for RTL8192 based WLAN 
cards\n");
        printk(KERN_INFO "Copyright (c) 2007-2008, Realsil Wlan\n");
        RT_TRACE(COMP_INIT, "Initializing module");
        RT_TRACE(COMP_INIT, "Wireless extensions version %d", WIRELESS_EXT);
-       rtl8192_proc_module_init();
-       return usb_register(&rtl8192_usb_driver);
+
+       ret = rtl8192_proc_module_init();
+       if (ret) {
+               pr_err("rtl8192_proc_module_init() failed %d\n", ret);
+               goto fail_proc;
+       }
+
+       ret = usb_register(&rtl8192_usb_driver);
+       if (ret) {
+               pr_err("usb_register() failed %d\n", ret);
+               goto fail_usb;
+       }
+
+       return 0;
+
+fail_usb:
+       rtl8192_proc_module_remove();
+fail_proc:
+       ieee80211_crypto_wep_exit();
+fail_crypto_wep:
+       ieee80211_crypto_ccmp_exit();
+fail_crypto_ccmp:
+       ieee80211_crypto_tkip_exit();
+fail_crypto_tkip:
+       ieee80211_crypto_deinit();
+fail_crypto:
+#ifdef CONFIG_IEEE80211_DEBUG
+       ieee80211_debug_exit();
+#endif
+       return ret;
 }
 
 


Patches currently in longterm-queue-2.6.32 which might be from 
[email protected] are

/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/cxgb3-declare-module_firmware.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/bnx2x-declare-module_firmware.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/myri10ge-declare-module_firmware.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/kconfig-avoid-buffer-underrun-in-choice-input.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/staging-rtl8192su-fix-procfs-code-for-interfaces-not.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/netx-declare-module_firmware.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/staging-rtl8192su-clean-up-in-case-of-an-error-in-mo.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/pcnet-cs-declare-module_firmware.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/spider-net-declare-module_firmware.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/tms380tr-declare-module_firmware.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to