]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hsr: Handle failures in module init
authorFelix Maurer <fmaurer@redhat.com>
Fri, 15 Mar 2024 12:04:52 +0000 (13:04 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:22:42 +0000 (18:22 -0400)
commit9a4e0ec0624c5b3e07fb042b307b98c3543de2f4
tree21ebcb14df6a44b1c96a8a86a6d9577c4ba4fb53
parentbec6c4ce1169a565c58c347d5d0ac22e46d507d6
hsr: Handle failures in module init

[ Upstream commit 3cf28cd492308e5f63ed00b29ea03ca016264376 ]

A failure during registration of the netdev notifier was not handled at
all. A failure during netlink initialization did not unregister the netdev
notifier.

Handle failures of netdev notifier registration and netlink initialization.
Both functions should only return negative values on failure and thereby
lead to the hsr module not being loaded.

Fixes: f421436a591d ("net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0)")
Signed-off-by: Felix Maurer <fmaurer@redhat.com>
Reviewed-by: Shigeru Yoshida <syoshida@redhat.com>
Reviewed-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/r/3ce097c15e3f7ace98fc7fd9bcbf299f092e63d1.1710504184.git.fmaurer@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/hsr/hsr_main.c