]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
iwlwifi: remove CMD_WANT_SKB flag if send_cmd_sync failure
authorZhu Yi <yi.zhu@intel.com>
Thu, 8 Jan 2009 18:19:58 +0000 (10:19 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 16 Jan 2009 22:08:23 +0000 (17:08 -0500)
In function iwl_send_cmd_sync(), if the flag CMD_WANT_SKB is set but
we are not provided with a valid SKB (cmd->meta.u.skb == NULL), we need
to remove the CMD_WANT_SKB flag from the TX cmd queue. Otherwise in case
the cmd comes in later, it will possibly set an invalid address. Thus
it causes an invalid memory access.

This fixed the bug http://bugzilla.kernel.org/show_bug.cgi?id=11326.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-hcmd.c
drivers/net/wireless/iwlwifi/iwl3945-base.c

index 8c71ad4f88c5f98e027293a1459d5700a388bb17..4b35b30e493e8abc82a90aa393d018683fa2359b 100644 (file)
@@ -224,7 +224,7 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
                IWL_ERROR("Error: Response NULL in '%s'\n",
                          get_cmd_string(cmd->id));
                ret = -EIO;
-               goto out;
+               goto cancel;
        }
 
        ret = 0;
index d64580805d6efbef7cb48a5bafec23ca02f55f6d..15f5655c636e2ce8c8dbb4cda119737a98413fb6 100644 (file)
@@ -745,7 +745,7 @@ static int iwl3945_send_cmd_sync(struct iwl3945_priv *priv, struct iwl3945_host_
                IWL_ERROR("Error: Response NULL in '%s'\n",
                          get_cmd_string(cmd->id));
                ret = -EIO;
-               goto out;
+               goto cancel;
        }
 
        ret = 0;