Commit 571cf296 authored by Po Liu's avatar Po Liu Committed by David S. Miller

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarPo Liu <Po.Liu@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7f960633
......@@ -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);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment