Skip to content

Commit

Permalink
mwl8k: prevent crash in ->configure_filter() if no interface was added
Browse files Browse the repository at this point in the history
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Acked-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Lennert Buytenhek authored and John W. Linville committed Aug 7, 2009
1 parent 37055bd commit a94cc97
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/net/wireless/mwl8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ struct mwl8k_vif {
*/
};

#define MWL8K_VIF(_vif) (struct mwl8k_vif *)(&((_vif)->drv_priv))
#define MWL8K_VIF(_vif) ((struct mwl8k_vif *)&((_vif)->drv_priv))

static const struct ieee80211_channel mwl8k_channels[] = {
{ .center_freq = 2412, .hw_value = 1, },
Expand Down Expand Up @@ -3219,15 +3219,19 @@ static int mwl8k_configure_filter_wt(struct work_struct *wt)
struct dev_addr_list *mclist = worker->mclist;

struct mwl8k_priv *priv = hw->priv;
struct mwl8k_vif *mv_vif;
int rc = 0;

if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
rc = mwl8k_cmd_set_pre_scan(hw);
else {
mv_vif = MWL8K_VIF(priv->vif);
rc = mwl8k_cmd_set_post_scan(hw, mv_vif->bssid);
u8 *bssid;

bssid = "\x00\x00\x00\x00\x00\x00";
if (priv->vif != NULL)
bssid = MWL8K_VIF(priv->vif)->bssid;

rc = mwl8k_cmd_set_post_scan(hw, bssid);
}
}

Expand Down

0 comments on commit a94cc97

Please sign in to comment.