Bläddra i källkod

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
Harprit Chhabada 6 år sedan
förälder
incheckning
38d7f92a30
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c

+ 1 - 1
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) {