]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: fec: avoid lock evasion when reading pps_enable
authorWei Fang <wei.fang@nxp.com>
Tue, 21 May 2024 02:38:00 +0000 (10:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:39:48 +0000 (13:39 +0200)
commit2cc3da9ae0f406f4ded6e90f5f903a45b3f06f81
tree1af6807da817e6cd8c6dce909cbf9e70a9f5f950
parentb8d78a7573ff7b877afe34e087b0cce3281f344b
net: fec: avoid lock evasion when reading pps_enable

[ Upstream commit 3b1c92f8e5371700fada307cc8fd2c51fa7bc8c1 ]

The assignment of pps_enable is protected by tmreg_lock, but the read
operation of pps_enable is not. So the Coverity tool reports a lock
evasion warning which may cause data race to occur when running in a
multithread environment. Although this issue is almost impossible to
occur, we'd better fix it, at least it seems more logically reasonable,
and it also prevents Coverity from continuing to issue warnings.

Fixes: 278d24047891 ("net: fec: ptp: Enable PPS output based on ptp clock")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Link: https://lore.kernel.org/r/20240521023800.17102-1-wei.fang@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/freescale/fec_ptp.c