Skip to content
Permalink
Browse files

net: arp: No need to check pkt for NULL

The pkt variable cannot be NULL at this point so the check for
nullness is not needed.

Coverity-CID: 198002
Fixes #15777

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
  • Loading branch information...
jukkar committed May 2, 2019
1 parent 99fae68 commit c4fcc604e647d2589c0f9fe16a5a83f089eec934
Showing with 1 addition and 1 deletion.
  1. +1 −1 subsys/net/l2/ethernet/arp.c
@@ -297,7 +297,7 @@ static inline struct net_pkt *arp_prepare(struct net_if *iface,
memcpy(hdr->src_hwaddr.addr, net_pkt_lladdr_src(pkt)->addr,
sizeof(struct net_eth_addr));

if (!entry || (pkt != NULL && net_pkt_ipv4_auto(pkt))) {
if (!entry || net_pkt_ipv4_auto(pkt)) {
my_addr = current_ip;
} else {
my_addr = if_get_addr(entry->iface, current_ip);

0 comments on commit c4fcc60

Please sign in to comment.
You can’t perform that action at this time.