|
@@ -3287,14 +3287,19 @@ void hdd_update_hw_sw_info(struct hdd_context *hdd_ctx)
|
|
|
&hdd_ctx->target_hw_revision,
|
|
|
&target_hw_name);
|
|
|
|
|
|
- if (hdd_ctx->target_hw_name)
|
|
|
- qdf_mem_free(hdd_ctx->target_hw_name);
|
|
|
+ qdf_mem_zero(hdd_ctx->target_hw_name, MAX_TGT_HW_NAME_LEN);
|
|
|
|
|
|
target_hw_name_len = strlen(target_hw_name) + 1;
|
|
|
- hdd_ctx->target_hw_name = qdf_mem_malloc(target_hw_name_len);
|
|
|
- if (hdd_ctx->target_hw_name)
|
|
|
+
|
|
|
+ if (target_hw_name_len <= MAX_TGT_HW_NAME_LEN) {
|
|
|
qdf_mem_copy(hdd_ctx->target_hw_name, target_hw_name,
|
|
|
target_hw_name_len);
|
|
|
+ } else {
|
|
|
+ hdd_err("target_hw_name_len is greater than MAX_TGT_HW_NAME_LEN");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ hdd_debug("target_hw_name = %s", hdd_ctx->target_hw_name);
|
|
|
|
|
|
buf = qdf_mem_malloc(WE_MAX_STR_LEN);
|
|
|
if (buf) {
|
|
@@ -4424,11 +4429,6 @@ power_down:
|
|
|
if (!reinit && !unint)
|
|
|
pld_power_off(qdf_dev->dev);
|
|
|
release_lock:
|
|
|
- if (hdd_ctx->target_hw_name) {
|
|
|
- qdf_mem_free(hdd_ctx->target_hw_name);
|
|
|
- hdd_ctx->target_hw_name = NULL;
|
|
|
- }
|
|
|
-
|
|
|
cds_shutdown_notifier_purge();
|
|
|
hdd_check_for_leaks(hdd_ctx, reinit);
|
|
|
hdd_debug_domain_set(QDF_DEBUG_DOMAIN_INIT);
|
|
@@ -14917,11 +14917,6 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode)
|
|
|
if (!hif_ctx)
|
|
|
ret = -EINVAL;
|
|
|
|
|
|
- if (hdd_ctx->target_hw_name) {
|
|
|
- qdf_mem_free(hdd_ctx->target_hw_name);
|
|
|
- hdd_ctx->target_hw_name = NULL;
|
|
|
- }
|
|
|
-
|
|
|
if (hdd_get_conparam() == QDF_GLOBAL_EPPING_MODE) {
|
|
|
epping_disable();
|
|
|
epping_close();
|