fdb_add() ignored any errors returned by the hardware. Return error for that case. Not carrying a fix tag: filling up 4096-entry table with static entries is just asking for trouble. Signed-off-by: David Yang --- drivers/net/dsa/motorcomm/chip.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c index 33e5fc127244..a7a9a7439304 100644 --- a/drivers/net/dsa/motorcomm/chip.c +++ b/drivers/net/dsa/motorcomm/chip.c @@ -725,7 +725,13 @@ yt921x_fdb_add(struct yt921x_priv *priv, const unsigned char *addr, u16 vid, if (res) return res; - return yt921x_fdb_wait(priv, &val); + res = yt921x_fdb_wait(priv, &val); + if (res) + return res; + if (val & YT921X_FDB_RESULT_NOTFOUND) + return -ENOSPC; + + return 0; } static int -- 2.53.0