From 38d7f92a306e484808c235d2065cd5376d05cd88 Mon Sep 17 00:00:00 2001 From: Harprit Chhabada Date: Tue, 23 Oct 2018 16:31:51 -0700 Subject: [PATCH] qcacmn: Fix null pointer dereference, wlan_cp_stats_psoc_obj_create_handler In wlan_cp_stats_psoc_obj_create_handler() multiple error paths lead to label wlan_cp_stats_psoc_obj_create_handler_return. In the label, posc_cs is not null checked before passing to the csc->cp_stats_psoc_obj_deinit() causing NULL pointer dereference. Change-Id: I82a48cee7d2734a96960aeedff42fc4cdf94bf9c CRs-Fixed: 2336830 --- umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c b/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c index caf16bc33f05..dbe4ed930d6d 100644 --- a/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c +++ b/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c @@ -96,7 +96,7 @@ wlan_cp_stats_psoc_obj_create_handler(struct wlan_objmgr_psoc *psoc, void *arg) wlan_cp_stats_psoc_obj_create_handler_return: if (QDF_IS_STATUS_ERROR(status)) { if (csc) { - if (csc->cp_stats_psoc_obj_deinit) + if (csc->cp_stats_psoc_obj_deinit && psoc_cs) csc->cp_stats_psoc_obj_deinit(psoc_cs); if (csc->psoc_cs) {