wl12xx: free ap keys only in ap mode
authorEliad Peller <eliad@wizery.com>
Mon, 19 Mar 2012 09:32:55 +0000 (11:32 +0200)
committerLuciano Coelho <coelho@ti.com>
Tue, 10 Apr 2012 09:23:15 +0000 (12:23 +0300)
The ap keys should be freed only when removing
ap role (otherwise, some arbitrary data might
get freed).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/main.c

index 7618eb73cb332047f1e644fd7219dc8da9befcb9..e21d21d7de8e493551150ee6dc0433f6324ca61a 100644 (file)
@@ -2355,10 +2355,10 @@ deinit:
                for (i = 0; i < CONF_TX_MAX_AC_COUNT; i++)
                        wl12xx_free_rate_policy(wl,
                                                &wlvif->ap.ucast_rate_idx[i]);
+               wl1271_free_ap_keys(wl, wlvif);
        }
 
        wl12xx_tx_reset_wlvif(wl, wlvif);
-       wl1271_free_ap_keys(wl, wlvif);
        if (wl->last_wlvif == wlvif)
                wl->last_wlvif = NULL;
        list_del(&wlvif->list);