From ccd7fdcd23032c4b85174541986978bbc9f4c6d4 Mon Sep 17 00:00:00 2001 From: Jingxiang Ge Date: Fri, 21 Jun 2019 16:04:55 +0800 Subject: [PATCH] qcacld-3.0: Return ret for hdd_trigger_psoc_idle_restart When hdd_trigger_psoc_idle_restart is called from hdd_open, if the process has some signal pending, pld_idle_restart may return back before finishing start_modules. If keep running in hdd_open, when creating vdev it may access invalid pdev. In hdd_open, change to return failure if idle_restart returns error. Change-Id: I454d421d0758dd4e90c4b4fba1f65096c0834446 CRs-Fixed: 2476316 --- core/hdd/src/wlan_hdd_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8da3cdf3c2a5..dcffb5e6e6a1 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9392,6 +9392,8 @@ int hdd_psoc_idle_restart(struct device *dev) int hdd_trigger_psoc_idle_restart(struct hdd_context *hdd_ctx) { + int ret; + QDF_BUG(rtnl_is_locked()); if (hdd_ctx->driver_status == DRIVER_MODULES_ENABLED) { @@ -9400,9 +9402,9 @@ int hdd_trigger_psoc_idle_restart(struct hdd_context *hdd_ctx) return 0; } - pld_idle_restart(hdd_ctx->parent_dev, hdd_psoc_idle_restart); + ret = pld_idle_restart(hdd_ctx->parent_dev, hdd_psoc_idle_restart); - return 0; + return ret; } /**