From fb82d53055965a7079b41d6a4f380c199a103501 Mon Sep 17 00:00:00 2001 From: Will Huang Date: Wed, 21 Mar 2018 14:30:13 +0800 Subject: [PATCH] qcacmn: Add pdev NULL check in reg_set_country reg_set_country may be called by hdd_reg_notifier, which is running in a context of worker create outside driver, it may be scheduled to run during driver unloading process which set hdd_ctx->hdd_pdev to 0. Change-Id: Ie51d772294302ad6b04117847c28a556694e9bca CRs-Fixed: 2208085 --- umac/regulatory/core/src/reg_services.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index 2f4b43e943..8b7ef2a1ba 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -1413,6 +1413,11 @@ QDF_STATUS reg_set_country(struct wlan_objmgr_pdev *pdev, struct wlan_objmgr_psoc *psoc; struct cc_regdmn_s rd; + if (!pdev) { + reg_err("pdev is NULL"); + return QDF_STATUS_E_INVAL; + } + if (!country) { reg_err("country code is NULL"); return QDF_STATUS_E_INVAL;