realtek: don't treat first multicast portmask entry as reserved
authorJan Hoffmann <jan@3e8.eu>
Sat, 6 May 2023 23:05:31 +0000 (01:05 +0200)
committerSander Vanheule <sander@svanheule.net>
Sun, 7 May 2023 17:09:00 +0000 (19:09 +0200)
commit57df840670b6038866ebed877ed9827276b730fe
tree49ee57a1c4668e337ab103fdd41dc92aee5b0ffa
parent81931756e1490547f8a6e1ef510b52af28c60909
realtek: don't treat first multicast portmask entry as reserved

There doesn't appear to be a reason to do this, as only the last entry
is actually reserved for unknown multicast.

This also fixes two issues:
 - As the increment happened after the bounds check, the value of the
   actually reserved last entry could be overwritten.
 - On deletion of entries, a corresponding decrement was missing,
   causing the wrong entry to be marked as free.

Fixes: cde31976e375 ("realtek: Add support for Layer 2 Multicast")
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c
target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c