]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: core: failover: enforce mandatory ops and clean up redundant checks
authorZeeshan Ahmad <zeeshanahmad022019@gmail.com>
Mon, 2 Mar 2026 06:43:17 +0000 (11:43 +0500)
committerJakub Kicinski <kuba@kernel.org>
Wed, 4 Mar 2026 01:44:11 +0000 (17:44 -0800)
commitd6ca199568c53ece99aeeae1022d04f2fd8cde7f
treee9aa59b35bf10a558b45f7ea8377952917ac67c8
parentdfa77c0dd4ab267d3f1160617c95eab80181a76f
net: core: failover: enforce mandatory ops and clean up redundant checks

The failover framework requires 'ops' to be functional. Currently,
failover_register() allows an instance to be registered with NULL
ops, which leads to inconsistent NULL checks and potential NULL
pointer dereferences in the slave registration paths.

Harden the entry point by requiring non-NULL ops in
failover_register(). This ensures the 'fops' pointer is guaranteed
to be valid for any successfully registered failover instance.
Consequently, remove the now redundant NULL checks for 'fops'
throughout the module to simplify the logic.

Signed-off-by: Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
Link: https://patch.msgid.link/20260302064317.9964-1-zeeshanahmad022019@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/failover.c