Fix oops due to sysctl table check failure in Linux 2.6.24

Linux 2.6.24 has a sysctl table checker that rejects the tables
presented by the driver.  Make the code survive this condition.  Free
devname (or dev_name) before freeing the table.  Don't do it at the
unregister time, it's too late.

The sysctl tables still need to be fixed.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2795 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
proski 2007-10-29 04:19:27 +00:00
parent 01a0d01102
commit b7186f5480
2 changed files with 4 additions and 2 deletions

View File

@ -9723,6 +9723,7 @@ ath_dynamic_sysctl_register(struct ath_softc *sc)
sc->sc_sysctl_header = ATH_REGISTER_SYSCTL_TABLE(sc->sc_sysctls);
if (!sc->sc_sysctl_header) {
printk("%s: failed to register sysctls!\n", DEV_NAME(sc->sc_dev));
kfree(dev_name);
kfree(sc->sc_sysctls);
sc->sc_sysctls = NULL;
}
@ -9740,7 +9741,7 @@ ath_dynamic_sysctl_unregister(struct ath_softc *sc)
unregister_sysctl_table(sc->sc_sysctl_header);
sc->sc_sysctl_header = NULL;
}
if (sc->sc_sysctls[2].procname) {
if (sc->sc_sysctls && sc->sc_sysctls[2].procname) {
kfree(sc->sc_sysctls[2].procname);
sc->sc_sysctls[2].procname = NULL;
}

View File

@ -787,6 +787,7 @@ ieee80211_virtfs_latevattach(struct ieee80211vap *vap)
vap->iv_sysctl_header = ATH_REGISTER_SYSCTL_TABLE(vap->iv_sysctls);
if (!vap->iv_sysctl_header) {
printk("%s: failed to register sysctls!\n", vap->iv_dev->name);
kfree(devname);
kfree(vap->iv_sysctls);
vap->iv_sysctls = NULL;
}
@ -936,7 +937,7 @@ ieee80211_virtfs_vdetach(struct ieee80211vap *vap)
proc_madwifi_count--;
}
if (vap->iv_sysctls[2].procname) {
if (vap->iv_sysctls && vap->iv_sysctls[2].procname) {
kfree(vap->iv_sysctls[2].procname);
vap->iv_sysctls[2].procname = NULL;
}