Commit b35d6d4f authored by Tomasz Bursztyka's avatar Tomasz Bursztyka Committed by Anas Nashif
Browse files

net/ieee802154: Do not unreference one time too many a fragmented packet

In case the current packet is the same as the cached one, let's not
unreference it while clearing the cache.

Signed-off-by: default avatarTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
parent d14ba3c1
Loading
Loading
Loading
Loading
+6 −0
Changes for subsys/net/l2/ieee802154/ieee802154_fragment.c: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -530,8 +530,14 @@ static inline enum net_verdict fragment_add_to_cache(struct net_pkt *pkt)
			/* Assign buffer back to input packet. */
			pkt->buffer = cache->pkt->buffer;
			cache->pkt->buffer = NULL;
		} else {
			/* in case pkt == cache->pkt, we don't want
			 * to unref it while clearing the cach.
			 */
			cache->pkt = NULL;
		}


		fragment_reconstruct_packet(pkt);

		/* Once reassemble is done, cache is no longer needed. */