Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

linke li and committed by
Paolo Abeni
04172043 d72b7357

+1 -1
+1 -1
drivers/net/ethernet/mediatek/mtk_ppe.c
··· 580 580 581 581 idle = cur_idle; 582 582 entry->data.ib1 &= ~ib1_ts_mask; 583 - entry->data.ib1 |= hwe->ib1 & ib1_ts_mask; 583 + entry->data.ib1 |= ib1 & ib1_ts_mask; 584 584 } 585 585 } 586 586