mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
net: enetc: check the index of the SFI rather than the handle
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: 888ae5a395
("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>
This commit is contained in:
parent
c00ce5470a
commit
299efdc238
1 changed files with 1 additions and 1 deletions
|
@ -1247,7 +1247,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv,
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
index = enetc_get_free_index(priv);
|
index = enetc_get_free_index(priv);
|
||||||
if (sfi->handle < 0) {
|
if (index < 0) {
|
||||||
NL_SET_ERR_MSG_MOD(extack, "No Stream Filter resource!");
|
NL_SET_ERR_MSG_MOD(extack, "No Stream Filter resource!");
|
||||||
err = -ENOSPC;
|
err = -ENOSPC;
|
||||||
goto free_fmi;
|
goto free_fmi;
|
||||||
|
|
Loading…
Reference in a new issue