Commit b4ca6e83 authored by Jukka Rissanen's avatar Jukka Rissanen
Browse files

drivers/eth/mcux: Free net_buf using net_nbuf_unref

The driver was using net_buf_unref(). This technically works
ok but debugging the network buffer allocations is more
difficult if done like this.

Change-Id: If3453a49337c7a359c8af22cfdf331fccc697af5
Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
parent b9ac440d
Loading
Loading
Loading
Loading
+3 −3
Changes for drivers/ethernet/eth_mcux.c: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@ static void eth_rx(struct device *iface)

	if (sizeof(context->frame_buf) < frame_length) {
		SYS_LOG_ERR("frame too large (%d)\n", frame_length);
		net_buf_unref(buf);
		net_nbuf_unref(buf);
		status = ENET_ReadFrame(ENET, &context->enet_handle, NULL, 0);
		assert(status == kStatus_Success);
		return;
@@ -178,7 +178,7 @@ static void eth_rx(struct device *iface)
	if (status) {
		irq_unlock(imask);
		SYS_LOG_ERR("ENET_ReadFrame failed: %d\n", status);
		net_buf_unref(buf);
		net_nbuf_unref(buf);
		return;
	}

@@ -192,7 +192,7 @@ static void eth_rx(struct device *iface)
		if (!pkt_buf) {
			irq_unlock(imask);
			SYS_LOG_ERR("Failed to get fragment buf\n");
			net_buf_unref(buf);
			net_nbuf_unref(buf);
			assert(status == kStatus_Success);
			return;
		}