Parcourir la source

qcacld-3.0: Add check before invoking soft_unload

Add a sanity check to verify if the driver is loaded
before invoking soft driver unload.

Change-Id: Id6f735c1661104ac14410399a54953f962792644
CRs-Fixed: 3239752
Aditya Kodukula il y a 2 ans
Parent
commit
3249fbc1e2
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      core/hdd/src/wlan_hdd_main.c

+ 4 - 0
core/hdd/src/wlan_hdd_main.c

@@ -17928,6 +17928,7 @@ static int hdd_disable_wifi(struct hdd_context *hdd_ctx)
 		return -EINVAL;
 	}
 	hdd_ctx->is_wlan_disabled = true;
+	hdd_debug_rl("WiFi is disabled");
 
 	return 0;
 }
@@ -17992,6 +17993,9 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp,
 		break;
 	case WLAN_FORCE_DISABLE_STR:
 		hdd_nofl_debug("Received Force WiFi disable from framework\n");
+		if (!cds_is_driver_loaded())
+			goto exit;
+
 		hdd_wlan_soft_driver_unload();
 		goto exit;
 	default: