aboutsummaryrefslogtreecommitdiffstats
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorHerbert Xu <[email protected]>2025-01-14 03:15:19 +0000
committerHerbert Xu <[email protected]>2025-01-19 04:44:28 +0000
commit9d4f8e54cef2c42e23ef258833dbd06a1eaff89b (patch)
treec615255a7203eb9b9e3cca1fd3f6cd2b33322244 /net/switchdev/switchdev.c
parentdt-bindings: crypto: qcom,inline-crypto-engine: Document the SM8750 ICE (diff)
downloadkernel-9d4f8e54cef2c42e23ef258833dbd06a1eaff89b.tar.gz
kernel-9d4f8e54cef2c42e23ef258833dbd06a1eaff89b.zip
rhashtable: Fix rhashtable_try_insert test
The test on whether rhashtable_insert_one did an insertion relies on the value returned by rhashtable_lookup_one. Unfortunately that value is overwritten after rhashtable_insert_one returns. Fix this by moving the test before data gets overwritten. Simplify the test as only data == NULL matters. Finally move atomic_inc back within the lock as otherwise it may be reordered with the atomic_dec on the removal side, potentially leading to an underflow. Reported-by: Michael Kelley <[email protected]> Fixes: e1d3422c95f0 ("rhashtable: Fix potential deadlock by moving schedule_work outside lock") Signed-off-by: Herbert Xu <[email protected]> Tested-by: Michael Kelley <[email protected]> Reviewed-by: Breno Leitao <[email protected]> Tested-by: Mikhail Zaslonko <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions