Skip to content

Commit 299efdc

Browse files
WeiFang-NXPdavem330
authored andcommitted
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: 888ae5a ("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>
1 parent c00ce54 commit 299efdc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/ethernet/freescale/enetc/enetc_qos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv,
12471247
int index;
12481248

12491249
index = enetc_get_free_index(priv);
1250-
if (sfi->handle < 0) {
1250+
if (index < 0) {
12511251
NL_SET_ERR_MSG_MOD(extack, "No Stream Filter resource!");
12521252
err = -ENOSPC;
12531253
goto free_fmi;

0 commit comments

Comments
 (0)