mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
rocker: Fix memory leak in ofdpa_port_fdb()
In ofdpa_port_fdb(), the hash_del() only unlinks the node from hash table, but does not free it. Fix this by adding kfree(found) after the !found == removing check, where the pointer value is no longer needed. Found by Coccinelle kfree script. Cc: <stable+noautosel@kernel.org> # rocker is a test harness, it's never loaded on production systems Signed-off-by: Ziran Zhang <zhangcoder@yeah.net> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20260616013245.7098-1-zhangcoder@yeah.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
56abdaebbf
commit
53442aad1d
|
|
@ -1924,6 +1924,9 @@ static int ofdpa_port_fdb(struct ofdpa_port *ofdpa_port,
|
|||
flags |= OFDPA_OP_FLAG_REFRESH;
|
||||
}
|
||||
|
||||
if (found && removing)
|
||||
kfree(found);
|
||||
|
||||
return ofdpa_port_fdb_learn(ofdpa_port, flags, addr, vlan_id);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user