fsl_enet.c memory deallocation bug

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fsl_enet.c memory deallocation bug

317 Views
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 */

 

Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

270 Views
_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 Kudos
Reply