瀏覽代碼

qcacmn: Fix invalid memory node access for DBR

Memory node pointer to unaligned vaddr, and it free the vaddr firstly
and then remove the memory node, which cause invalid memory access.
This change remove memory node firstly, and then free the unaligned
vaddr.

Change-Id: I3b81c1eb4df7c786a3deec456294107ee3b8f226
CRs-Fixed: 3118545
Wu Gao 3 年之前
父節點
當前提交
137c2dde1f
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c

+ 2 - 2
target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c

@@ -1,6 +1,6 @@
 /*
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -561,8 +561,8 @@ target_if_dbr_deinit_mem_list(struct direct_buf_rx_psoc_obj *dbr_psoc_obj)
 	for (i = 0; i < QDF_ARRAY_SIZE(dbr_psoc_obj->mem_list); i++) {
 	for (i = 0; i < QDF_ARRAY_SIZE(dbr_psoc_obj->mem_list); i++) {
 		mem_list = &dbr_psoc_obj->mem_list[i];
 		mem_list = &dbr_psoc_obj->mem_list[i];
 		qdf_list_for_each_del(mem_list, cur, next, node) {
 		qdf_list_for_each_del(mem_list, cur, next, node) {
-			qdf_mem_free(cur->vaddr_unaligned);
 			qdf_list_remove_node(mem_list, &cur->node);
 			qdf_list_remove_node(mem_list, &cur->node);
+			qdf_mem_free(cur->vaddr_unaligned);
 		}
 		}
 
 
 		qdf_list_destroy(mem_list);
 		qdf_list_destroy(mem_list);