diff options
author | Leo Kim <leo.kim@atmel.com> | 2016-03-18 15:23:16 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-23 05:22:13 +0300 |
commit | 8827bd88efcb7e5976585b9b35a551d7c56f8efb (patch) | |
tree | ee5cf65841f3be83c4275aa334407f542f2f0f16 /drivers | |
parent | bd3a3cd6c27b117fb9a43a38c8072c95332beecc (diff) | |
download | linux-8827bd88efcb7e5976585b9b35a551d7c56f8efb.tar.xz |
staging: wilc1000: fixed kernel panic when firmware is not started
This patch fixed the problems caused by if firmware is not started.
That is why, in nl80211 put current TX power in interface info.
If firmware is not started, this function(get_tx_power) does not work.
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index b76622d1adc3..448a5c8c4514 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -2170,6 +2170,13 @@ static int get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, int ret; struct wilc_priv *priv = wiphy_priv(wiphy); struct wilc_vif *vif = netdev_priv(priv->dev); + struct wilc *wl; + + wl = vif->wilc; + + /* If firmware is not started, return. */ + if (!wl->initialized) + return -EIO; ret = wilc_get_tx_power(vif, (u8 *)dbm); if (ret) |