Commit ed0dcca2 authored by Jukka Rissanen's avatar Jukka Rissanen Committed by Benjamin Cabé
Browse files

net: ethernet: bridge: Avoid null pointer access



If the packet cloning failed, bail out in order to avoid
null pointer access.

Fixes #81992
Coverity-CID: 434493

Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@nordicsemi.no>
parent 8780d912
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -372,6 +372,11 @@ static enum net_verdict bridge_iface_process(struct net_if *iface,
			 */
			if (count > 2) {
				send_pkt = net_pkt_clone(pkt, K_NO_WAIT);
				if (send_pkt == NULL) {
					NET_DBG("DROP: clone failed");
					break;
				}

				net_pkt_ref(send_pkt);
			} else {
				send_pkt = net_pkt_ref(pkt);