MLK-18275 wireless: bcmdhd: fix the un-supported country code set by regdb
authorAndy Duan <fugang.duan@nxp.com>
Thu, 10 May 2018 11:49:48 +0000 (19:49 +0800)
committerAndy Duan <fugang.duan@nxp.com>
Fri, 11 May 2018 02:50:11 +0000 (10:50 +0800)
Driver should return when un-supported country code set by regdb.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit: 9b3b65ec3df5ed7b404784ae4ef4cf9f906c0520)

drivers/net/wireless/bcmdhd/wl_cfg80211.c
drivers/net/wireless/bcmdhd_1363/wl_cfg80211.c

index 4ae767f..3958b23 100644 (file)
@@ -8110,6 +8110,11 @@ wl_cfg80211_reg_notifier(
                /* in case of no supported country by regdb
                     lets driver setup platform default Locale
                */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0))
+               return -EINVAL;
+#else
+               return;
+#endif /* kernel version < 3.9.0 */
        }
 
        WL_ERR(("Set country code %c%c from %s\n",
index f0836bd..4b45bed 100644 (file)
@@ -9428,6 +9428,11 @@ wl_cfg80211_reg_notifier(
                /* in case of no supported country by regdb
                     lets driver setup platform default Locale
                */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0))
+               return -EINVAL;
+#else
+               return;
+#endif /* kernel version < 3.9.0 */
        }
 
        WL_ERR(("Set country code %c%c from %s\n",