Skip to content
Commit 0066623d authored by Breno Leitao's avatar Breno Leitao Committed by Jakub Kicinski
Browse files

net: netconsole: Eliminate redundant setting of enabled field



When disabling a netconsole target, enabled_store() is called with
enabled=false. Currently, this results in updating the nt->enabled
field twice:

1. Inside the if/else block, with the target_list_lock spinlock held
2. Later, without the target_list_lock

This patch eliminates the redundancy by setting the field only once,
improving efficiency and reducing potential race conditions.

Signed-off-by: default avatarBreno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20240709144403.544099-3-leitao@debian.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a9359e8b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment