diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-06-28 11:44:21 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-21 05:42:18 (GMT) |
commit | bee8070548921f8de7b9aee7cfddd64bf8fa43e1 (patch) | |
tree | 4cbd9012359abb763d0210fddbe9a1b9a2426ea2 /drivers/net | |
parent | e5e5c0ec39dd380804c7c4be838da42392e3a44f (diff) | |
download | linux-bee8070548921f8de7b9aee7cfddd64bf8fa43e1.tar.xz |
rocker: move dereference before free
commit acb4b7df48b539cb391287921de57e4e5fae3460 upstream.
My static checker complains that ofdpa_neigh_del() can sometimes free
"found". It just makes sense to use it first before deleting it.
Fixes: ecf244f753e0 ("rocker: fix maybe-uninitialized warning")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/rocker/rocker_ofdpa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/rocker/rocker_ofdpa.c b/drivers/net/ethernet/rocker/rocker_ofdpa.c index 4ca4613..b1af7cd 100644 --- a/drivers/net/ethernet/rocker/rocker_ofdpa.c +++ b/drivers/net/ethernet/rocker/rocker_ofdpa.c @@ -1505,8 +1505,8 @@ static int ofdpa_port_ipv4_nh(struct ofdpa_port *ofdpa_port, *index = entry->index; resolved = false; } else if (removing) { - ofdpa_neigh_del(trans, found); *index = found->index; + ofdpa_neigh_del(trans, found); } else if (updating) { ofdpa_neigh_update(found, trans, NULL, false); resolved = !is_zero_ether_addr(found->eth_dst); |