]> git.itanic.dy.fi Git - linux-stable/commit
net: enetc: check the index of the SFI rather than the handle
authorWei Fang <wei.fang@nxp.com>
Thu, 4 May 2023 08:03:59 +0000 (16:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:50:19 +0000 (11:50 +0200)
commit53f7b55f6b3a5e20d5f9f1e3e8b3a15ae95db354
tree78c1933909f4a17ae1f87aa481191a341bfa4ca2
parenta0cb00295dbeeacfbdf316f9d10e856f5b4ae2d3
net: enetc: check the index of the SFI rather than the handle

[ Upstream commit 299efdc2380aac588557f4d0b2ce7bee05bd0cf2 ]

We should check whether the current SFI (Stream Filter Instance) table
is full before creating a new SFI entry. However, the previous logic
checks the handle by mistake and might lead to unpredictable behavior.

Fixes: 888ae5a3952b ("net: enetc: add tc flower psfp offload driver")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/freescale/enetc/enetc_qos.c