diff options
author | linke li <lilinke99@qq.com> | 2024-04-03 05:54:00 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-04-04 16:46:52 +0300 |
commit | 04172043bd218dbbfc0c13bd4630142eb3f027cb (patch) | |
tree | de9673c692bd5f7ea73fe6a83381714aa7772ff8 | |
parent | d72b735712e65cccb85f81e6b26a14ea53cc6438 (diff) | |
download | linux-04172043bd218dbbfc0c13bd4630142eb3f027cb.tar.xz |
net: ethernet: mtk_eth_soc: Reuse value using READ_ONCE instead of re-rereading it
In mtk_flow_entry_update_l2, the hwe->ib1 is read using READ_ONCE at the
beginning of the function, checked, and then re-read from hwe->ib1,
may void all guarantees of the checks. Reuse the value that was read by
READ_ONCE to ensure the consistency of the ib1 throughout the function.
Signed-off-by: linke li <lilinke99@qq.com>
Link: https://lore.kernel.org/r/tencent_C699E9540505523424F11A9BD3D21B86840A@qq.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r-- | drivers/net/ethernet/mediatek/mtk_ppe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c index 6ce0db3a1a92..0acee405a749 100644 --- a/drivers/net/ethernet/mediatek/mtk_ppe.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe.c @@ -580,7 +580,7 @@ mtk_flow_entry_update_l2(struct mtk_ppe *ppe, struct mtk_flow_entry *entry) idle = cur_idle; entry->data.ib1 &= ~ib1_ts_mask; - entry->data.ib1 |= hwe->ib1 & ib1_ts_mask; + entry->data.ib1 |= ib1 & ib1_ts_mask; } } |