소스 검색

Merge "qcacmn: Possible NULL vdev access in get_cm_ctx_fl"

Linux Build Service Account 1 년 전
부모
커밋
e24451093c
2개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 0
      umac/mlme/connection_mgr/core/src/wlan_cm_util.c
  2. 3 1
      umac/mlme/mlme_objmgr/dispatcher/inc/wlan_mlme_dbg.h

+ 5 - 0
umac/mlme/connection_mgr/core/src/wlan_cm_util.c

@@ -74,6 +74,11 @@ struct cnx_mgr *cm_get_cm_ctx_fl(struct wlan_objmgr_vdev *vdev,
 	struct vdev_mlme_obj *vdev_mlme;
 	struct cnx_mgr *cm_ctx = NULL;
 
+	if (!vdev) {
+		mlme_rl_nofl_err("%s:%u: vdev is NULL", func, line);
+		return NULL;
+	}
+
 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
 	if (vdev_mlme)
 		cm_ctx = vdev_mlme->cnx_mgr_ctx;

+ 3 - 1
umac/mlme/mlme_objmgr/dispatcher/inc/wlan_mlme_dbg.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -58,5 +58,7 @@
 #define mlme_rl_debug(format, args...) \
 		QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_CMN_MLME, format, ## args)
 
+#define mlme_rl_nofl_err(format, args...) \
+	QDF_TRACE_ERROR_RL_NO_FL(QDF_MODULE_ID_CMN_MLME, format, ## args)
 #endif    /* _WLAN_MLME_DBG_H_ */