Commit 2de6e8da authored by Luiz Augusto von Dentz's avatar Luiz Augusto von Dentz Committed by Anas Nashif
Browse files

net: buf: Add debug for fragments



net_buf_unref actually unrefs the fragments but it only logs information
of the parent.

Change-Id: I03208f250d030b7927d68c8da442f830f6070dc3
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent e891c290
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -135,12 +135,17 @@ void net_buf_put(struct k_fifo *fifo, struct net_buf *buf)
void net_buf_unref(struct net_buf *buf)
{
	NET_BUF_ASSERT(buf);

	while (buf) {
		struct net_buf *frags = buf->frags;

		NET_BUF_ASSERT(buf->ref > 0);
		NET_BUF_DBG("buf %p ref %u fifo %p frags %p", buf, buf->ref,
			    buf->free, buf->frags);

	while (buf && --buf->ref == 0) {
		struct net_buf *frags = buf->frags;
		if (--buf->ref > 0) {
			return;
		}

		buf->frags = NULL;