]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: netconsole: Eliminate redundant setting of enabled field
authorBreno Leitao <leitao@debian.org>
Tue, 9 Jul 2024 14:44:00 +0000 (07:44 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 12 Jul 2024 01:32:48 +0000 (18:32 -0700)
commit0066623d40085bb5d0af8d645a3bba27fc5cfced
tree91a6bc92f672ab709a03338ef89e1ca7a4d6b979
parenta9359e8b0065a76cc11791f668bce3e9c7bf4fef
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: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20240709144403.544099-3-leitao@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netconsole.c