fjpanag commented on code in PR #7525:
URL: https://github.com/apache/nuttx/pull/7525#discussion_r1119870510


##########
net/ieee802154/ieee802154_conn.c:
##########
@@ -188,9 +198,22 @@ void ieee802154_conn_free(FAR struct ieee802154_conn_s 
*conn)
 
   memset(conn, 0, sizeof(*conn));
 
-  /* Free the connection */
+  /* If this is a preallocated or a batch allocated connection store it in
+   * the free connections list. Else free it.
+   */
+
+#if CONFIG_NET_IEEE802154_ALLOC_CONNS == 1
+  if (conn < g_ieee802154_connections || conn >= (g_ieee802154_connections +
+      CONFIG_NET_IEEE802154_PREALLOC_CONNS))
+    {
+      kmm_free(conn);
+    }
+  else
+#endif
+    {
+      dq_addlast(&conn->sconn.node, &g_free_ieee802154_connections);

Review Comment:
   @pkarashchenko see #8669.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to