浏览代码

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>
Leo Kim 9 年之前
父节点
当前提交
8827bd88ef
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

+ 7 - 0
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;
 	int ret;
 	struct wilc_priv *priv = wiphy_priv(wiphy);
 	struct wilc_priv *priv = wiphy_priv(wiphy);
 	struct wilc_vif *vif = netdev_priv(priv->dev);
 	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);
 	ret = wilc_get_tx_power(vif, (u8 *)dbm);
 	if (ret)
 	if (ret)