aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas
diff options
context:
space:
mode:
authorEugene Teo <eugeneteo@kernel.sg>2007-08-02 13:18:07 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:50:14 -0400
commitb031ac10264fa9b805d84b4a440407ac950390cf (patch)
treedc46c9be3c3fc2754cf213dfa5bb2c758b0c105e /drivers/net/wireless/libertas
parent5707708111ca6c4e9a1160acffdc98a98d95e462 (diff)
[PATCH] drivers/net/wireless/libertas/cmd.c: fix adapter->driver_lock dereference
adapter is NULL if cmdnode is not. Signed-off-by: Eugene Teo <eugeneteo@kernel.sg> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r--drivers/net/wireless/libertas/cmd.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 257d6443f6c7..72e8e27a6fb7 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -958,7 +958,7 @@ static int DownloadcommandToStation(wlan_private * priv,
958 unsigned long flags; 958 unsigned long flags;
959 struct cmd_ds_command *cmdptr; 959 struct cmd_ds_command *cmdptr;
960 wlan_adapter *adapter = priv->adapter; 960 wlan_adapter *adapter = priv->adapter;
961 int ret = 0; 961 int ret = -1;
962 u16 cmdsize; 962 u16 cmdsize;
963 u16 command; 963 u16 command;
964 964
@@ -966,12 +966,6 @@ static int DownloadcommandToStation(wlan_private * priv,
966 966
967 if (!adapter || !cmdnode) { 967 if (!adapter || !cmdnode) {
968 lbs_deb_host("DNLD_CMD: adapter or cmdmode is NULL\n"); 968 lbs_deb_host("DNLD_CMD: adapter or cmdmode is NULL\n");
969 if (cmdnode) {
970 spin_lock_irqsave(&adapter->driver_lock, flags);
971 __libertas_cleanup_and_insert_cmd(priv, cmdnode);
972 spin_unlock_irqrestore(&adapter->driver_lock, flags);
973 }
974 ret = -1;
975 goto done; 969 goto done;
976 } 970 }
977 971
@@ -982,7 +976,6 @@ static int DownloadcommandToStation(wlan_private * priv,
982 lbs_deb_host("DNLD_CMD: cmdptr is NULL or zero\n"); 976 lbs_deb_host("DNLD_CMD: cmdptr is NULL or zero\n");
983 __libertas_cleanup_and_insert_cmd(priv, cmdnode); 977 __libertas_cleanup_and_insert_cmd(priv, cmdnode);
984 spin_unlock_irqrestore(&adapter->driver_lock, flags); 978 spin_unlock_irqrestore(&adapter->driver_lock, flags);
985 ret = -1;
986 goto done; 979 goto done;
987 } 980 }
988 981
@@ -1008,7 +1001,6 @@ static int DownloadcommandToStation(wlan_private * priv,
1008 __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); 1001 __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd);
1009 adapter->cur_cmd = NULL; 1002 adapter->cur_cmd = NULL;
1010 spin_unlock_irqrestore(&adapter->driver_lock, flags); 1003 spin_unlock_irqrestore(&adapter->driver_lock, flags);
1011 ret = -1;
1012 goto done; 1004 goto done;
1013 } 1005 }
1014 1006