From e7ff49b2f4d0996d334df1f0f715c1af8d5609d8 Mon Sep 17 00:00:00 2001 From: Dundi Raviteja Date: Thu, 28 Jan 2021 18:21:12 +0530 Subject: [PATCH] icnss2: Use correct pointer to access icnss_priv state Server arrive may come before initializing penv which causes possible NULL pointer dereference. To address this, use function argument priv instead of global variable penv. Change-Id: I1355074614b4f30fff1c021db53654b4c844135c Signed-off-by: Dundi Raviteja --- drivers/soc/qcom/icnss2/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/qcom/icnss2/main.c b/drivers/soc/qcom/icnss2/main.c index 816b2b8c9504..e290a5c25778 100644 --- a/drivers/soc/qcom/icnss2/main.c +++ b/drivers/soc/qcom/icnss2/main.c @@ -555,7 +555,7 @@ static int icnss_driver_event_server_arrive(struct icnss_priv *priv, icnss_ignore_fw_timeout(false); - if (test_bit(ICNSS_WLFW_CONNECTED, &penv->state)) { + if (test_bit(ICNSS_WLFW_CONNECTED, &priv->state)) { icnss_pr_err("QMI Server already in Connected State\n"); ICNSS_ASSERT(0); }