Skip to content

Commit

Permalink
net:enetc: bug fix for qos sfi operate space after freed
Browse files Browse the repository at this point in the history
'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 <[email protected]>
Signed-off-by: Po Liu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
liupoer authored and davem330 committed May 7, 2020
1 parent 7f96063 commit 571cf29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/enetc/enetc_qos.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 571cf29

Please sign in to comment.