From 209124664c1ffdcd1e3bf6d936ca7c72378438b3 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Wed, 7 Jun 2017 13:48:25 -0700 Subject: [PATCH] qcacld-3.0: Free psoc when hdd_wlan_startup fails A psoc object is being created in hdd_wlan_startup, but not freed in case of an error. Free any allocated psoc object in hdd_wlan_startup as part of the existing error handling. Change-Id: I6292188c4b92198ea157f6e2f1519b89fc991ad5 CRs-Fixed: 2059166 --- core/hdd/src/wlan_hdd_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 4fea506ae019..7a5a561a745a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9324,7 +9324,7 @@ int hdd_wlan_startup(struct device *dev) ret = hdd_init_netlink_services(hdd_ctx); if (ret) - goto err_hdd_free_context; + goto err_hdd_free_psoc; hdd_request_manager_init(); hdd_green_ap_init(hdd_ctx); @@ -9479,6 +9479,10 @@ err_exit_nl_srv: hdd_exit_netlink_services(hdd_ctx); cds_deinit_ini_config(); + +err_hdd_free_psoc: + hdd_objmgr_release_and_destroy_psoc(hdd_ctx); + err_hdd_free_context: if (cds_is_fw_down()) hdd_err("Not setting the complete event as fw is down");