rfkill-wlan.c: solve null point panic when wifi_chip_type is not define in dts
authorhwg <hwg@rock-chips.com>
Thu, 5 Feb 2015 02:51:07 +0000 (10:51 +0800)
committerhwg <hwg@rock-chips.com>
Thu, 5 Feb 2015 02:52:39 +0000 (10:52 +0800)
net/rfkill/rfkill-wlan.c

index 9e9c5e716af7ab168a27c77ebc7b9d77aa74014b..6cf15eb72b1936a291b8416c57830a586e083649 100755 (executable)
@@ -631,8 +631,9 @@ static int wlan_platdata_parse_dt(struct device *dev,
     if (ret) {
         LOG("%s: Can not read wifi_chip_type, set default to rkwifi.\n", __func__);
         strcpy(wifi_chip_type_string, "rkwifi");
+    } else {
+        strcpy(wifi_chip_type_string, strings);
     }
-    strcpy(wifi_chip_type_string, strings);
     LOG("%s: wifi_chip_type = %s\n", __func__, wifi_chip_type_string);
 
        if(cpu_is_rk3036() || cpu_is_rk312x()){