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: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
parent
8780d912fa
commit
ed0dcca2fb
1 changed files with 5 additions and 0 deletions
|
@ -372,6 +372,11 @@ static enum net_verdict bridge_iface_process(struct net_if *iface,
|
||||||
*/
|
*/
|
||||||
if (count > 2) {
|
if (count > 2) {
|
||||||
send_pkt = net_pkt_clone(pkt, K_NO_WAIT);
|
send_pkt = net_pkt_clone(pkt, K_NO_WAIT);
|
||||||
|
if (send_pkt == NULL) {
|
||||||
|
NET_DBG("DROP: clone failed");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
net_pkt_ref(send_pkt);
|
net_pkt_ref(send_pkt);
|
||||||
} else {
|
} else {
|
||||||
send_pkt = net_pkt_ref(pkt);
|
send_pkt = net_pkt_ref(pkt);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue