From 14529fd551b30fa68018543bba25bc56e9880ad6 Mon Sep 17 00:00:00 2001 From: hwg Date: Thu, 5 Feb 2015 10:51:07 +0800 Subject: [PATCH] rfkill-wlan.c: solve null point panic when wifi_chip_type is not define in dts --- net/rfkill/rfkill-wlan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c index 9e9c5e716af7..6cf15eb72b19 100755 --- a/net/rfkill/rfkill-wlan.c +++ b/net/rfkill/rfkill-wlan.c @@ -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()){ -- 2.34.1