diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2009-08-03 19:58:57 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-07 17:09:32 (GMT) |
commit | a94cc97e14c5750ec2b50b2e4ecdfb0f369ed0f4 (patch) | |
tree | d29f78c4fcf664aaa8ddd1a8c79d169b34b6ed65 /drivers/net/wireless | |
parent | 37055bd455b31b8220c35a1ede9c6aceb791cc88 (diff) | |
download | linux-fsl-qoriq-a94cc97e14c5750ec2b50b2e4ecdfb0f369ed0f4.tar.xz |
mwl8k: prevent crash in ->configure_filter() if no interface was added
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Acked-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 25423c0..6e49117 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c @@ -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, }, @@ -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); } } |