fsl_enet.c memory deallocation bug

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

fsl_enet.c memory deallocation bug

359 次查看
kevin2024
Contributor I

Hello,

I couldn't see anywhere else to post a bug fix, so I will post here.

I have isolated a memory deallocation bug in the SDK ethernet driver code. I am using K66_180 with SDK version 2.11.0. The bug is located in the ENET_GetRxFrame() function. Briefly, the incorrect code supplies the address of the pointer to the memory to be deallocated rather than the memory to be deallocated. The diff to fix the bug is as follows:

--------------------------- drivers/fsl_enet.c ---------------------------
index cd30cab..feedd81 100644
@@ -2537,7 +2537,7 @@ status_t ENET_GetRxFrame(ENET_Type *base, enet_handle_t *handle, enet_rx_frame_s
             /* Free the incomplete frame buffers. */
             while (index-- != 0U)
             {
-                handle->rxBuffFree(base, &rxFrame->rxBuffArray[index].buffer, handle->userData, ringId);
+                handle->rxBuffFree(base, rxFrame->rxBuffArray[index].buffer, handle->userData, ringId);
             }
 
             /* Update left buffers as ready for next coming frame */

 

标签 (1)
标记 (1)
0 项奖励
回复
1 回复

312 次查看
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

Very good observation, this issue had not been noticed. I will report it to the corresponding department so that it can be corrected in the next review. I appreciate your feedback as it helps us improve our products.

Have a nice day!

0 项奖励
回复