Skip to content

Commit

Permalink
[PATCH] drivers/net/wireless/libertas/cmd.c: fix adapter->driver_lock…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Eugene Teo authored and David S. Miller committed Oct 10, 2007
1 parent 5707708 commit b031ac1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,20 +958,14 @@ static int DownloadcommandToStation(wlan_private * priv,
unsigned long flags;
struct cmd_ds_command *cmdptr;
wlan_adapter *adapter = priv->adapter;
int ret = 0;
int ret = -1;
u16 cmdsize;
u16 command;

lbs_deb_enter(LBS_DEB_HOST);

if (!adapter || !cmdnode) {
lbs_deb_host("DNLD_CMD: adapter or cmdmode is NULL\n");
if (cmdnode) {
spin_lock_irqsave(&adapter->driver_lock, flags);
__libertas_cleanup_and_insert_cmd(priv, cmdnode);
spin_unlock_irqrestore(&adapter->driver_lock, flags);
}
ret = -1;
goto done;
}

Expand All @@ -982,7 +976,6 @@ static int DownloadcommandToStation(wlan_private * priv,
lbs_deb_host("DNLD_CMD: cmdptr is NULL or zero\n");
__libertas_cleanup_and_insert_cmd(priv, cmdnode);
spin_unlock_irqrestore(&adapter->driver_lock, flags);
ret = -1;
goto done;
}

Expand All @@ -1008,7 +1001,6 @@ static int DownloadcommandToStation(wlan_private * priv,
__libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd);
adapter->cur_cmd = NULL;
spin_unlock_irqrestore(&adapter->driver_lock, flags);
ret = -1;
goto done;
}

Expand Down

0 comments on commit b031ac1

Please sign in to comment.