]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: ethernet: mtk_eth_soc: Reuse value using READ_ONCE instead of re-rereading it
authorlinke li <lilinke99@qq.com>
Wed, 3 Apr 2024 02:54:00 +0000 (10:54 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 4 Apr 2024 13:46:52 +0000 (15:46 +0200)
commit04172043bd218dbbfc0c13bd4630142eb3f027cb
treede9673c692bd5f7ea73fe6a83381714aa7772ff8
parentd72b735712e65cccb85f81e6b26a14ea53cc6438
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>
drivers/net/ethernet/mediatek/mtk_ppe.c