wl12xx: don't remove key if hlid was already deleted
authorEliad Peller <eliad@wizery.com>
Sun, 14 Aug 2011 10:17:31 +0000 (13:17 +0300)
committerLuciano Coelho <coelho@ti.com>
Mon, 22 Aug 2011 09:35:30 +0000 (12:35 +0300)
When wep key was removed after disconnection, sta_hlid was invalid,
and it resulted in a fw crash.

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

index 360e33ed3ddb09b8b7ab69622be80569404027c1..c917f69f0069c07ed3d77b52ed34dbc6c63a9e0c 100644 (file)
@@ -2625,6 +2625,11 @@ static int wl1271_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
                if (action == KEY_REMOVE && !is_broadcast_ether_addr(addr))
                        return 0;
 
+               /* don't remove key if hlid was already deleted */
+               if (action == KEY_REMOVE &&
+                   wl->sta_hlid == WL12XX_INVALID_LINK_ID)
+                       return 0;
+
                ret = wl1271_cmd_set_sta_key(wl, action,
                                             id, key_type, key_size,
                                             key, addr, tx_seq_32,