Commit acb4b7df authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

rocker: move dereference before free

My static checker complains that ofdpa_neigh_del() can sometimes free
"found".   It just makes sense to use it first before deleting it.

Fixes: ecf244f7 ("rocker: fix maybe-uninitialized warning")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6b27c8ad
...@@ -1505,8 +1505,8 @@ static int ofdpa_port_ipv4_nh(struct ofdpa_port *ofdpa_port, ...@@ -1505,8 +1505,8 @@ static int ofdpa_port_ipv4_nh(struct ofdpa_port *ofdpa_port,
*index = entry->index; *index = entry->index;
resolved = false; resolved = false;
} else if (removing) { } else if (removing) {
ofdpa_neigh_del(trans, found);
*index = found->index; *index = found->index;
ofdpa_neigh_del(trans, found);
} else if (updating) { } else if (updating) {
ofdpa_neigh_update(found, trans, NULL, false); ofdpa_neigh_update(found, trans, NULL, false);
resolved = !is_zero_ether_addr(found->eth_dst); resolved = !is_zero_ether_addr(found->eth_dst);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment