summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPo Liu <Po.Liu@nxp.com>2020-05-07 18:57:38 +0800
committerDavid S. Miller <davem@davemloft.net>2020-05-07 13:05:46 -0700
commit571cf29644542b9e410ed102cb35ecb27b4fdfa3 (patch)
tree9ce6f7827d196fa6d52357d8f58a2b7e1bd73c47 /drivers
parent7f960633a458136d168f2049508d39cba8be55bd (diff)
net:enetc: bug fix for qos sfi operate space after freed
'Dan Carpenter' reported: This code frees "sfi" and then dereferences it on the next line: > kfree(sfi); > clear_bit(sfi->index, epsfp.psfp_sfi_bitmap); This "sfi->index" should be "index". Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Po Liu <Po.Liu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/freescale/enetc/enetc_qos.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_qos.c b/drivers/net/ethernet/freescale/enetc/enetc_qos.c
index 172acb602ccb..fd3df19eaa32 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_qos.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_qos.c
@@ -903,7 +903,7 @@ static void stream_filter_unref(struct enetc_ndev_priv *priv, u32 index)
enetc_streamfilter_hw_set(priv, sfi, false);
hlist_del(&sfi->node);
kfree(sfi);
- clear_bit(sfi->index, epsfp.psfp_sfi_bitmap);
+ clear_bit(index, epsfp.psfp_sfi_bitmap);
}
}