fsl_enet.c memory deallocation bug

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

fsl_enet.c memory deallocation bug

356件の閲覧回数
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 返信

309件の閲覧回数
_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 件の賞賛
返信