]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: dsa: mv88e6xxx: Fix off-by-one in VTU devlink region size
authorTobias Waldekranz <tobias@waldekranz.com>
Wed, 21 Apr 2021 12:04:53 +0000 (14:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:50:14 +0000 (10:50 +0200)
commit6028a809f6cf6e10568cb0f17b2c89db7314147c
treec0c2d0c57b3eedcd18b9dee31f62dfe735724488
parenta38b1d3c08ccc11b786b7bc11282b38cb02b1709
net: dsa: mv88e6xxx: Fix off-by-one in VTU devlink region size

[ Upstream commit 281140a0a2ce4febf2c0ce5d29d0e7d961a826b1 ]

In the unlikely event of the VTU being loaded to the brim with 4k
entries, the last one was placed in the buffer, but the size reported
to devlink was off-by-one. Make sure that the final entry is available
to the caller.

Fixes: ca4d632aef03 ("net: dsa: mv88e6xxx: Export VTU as devlink region")
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/mv88e6xxx/devlink.c