wl12xx: don't remove key if hlid was already deleted
authorEliad Peller <eliad@wizery.com>
Sun, 14 Aug 2011 10:17:24 +0000 (13:17 +0300)
committerLuciano Coelho <coelho@ti.com>
Mon, 22 Aug 2011 09:35:28 +0000 (12:35 +0300)
If hlid was already removed, there is no need to remove
its key (it might cause a fw crash, as the key is invalid).

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

index d655e629677cf1e0c5f320cea02d569f1a6bbe2c..261807b45ab56859bda4a5155b8866206a95b63a 100644 (file)
@@ -1203,6 +1203,10 @@ int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
        struct wl1271_cmd_set_keys *cmd;
        int ret = 0;
 
+       /* hlid might have already been deleted */
+       if (wl->sta_hlid == WL12XX_INVALID_LINK_ID)
+               return 0;
+
        cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
        if (!cmd) {
                ret = -ENOMEM;