linux-stable/net/hsr
Felix Maurer 69f9f55891 hsr: Handle failures in module init
[ Upstream commit 3cf28cd492 ]

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: f421436a59 ("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>
2024-03-26 18:22:25 -04:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
hsr_debugfs.c hsr: rename debugfs file when interface name is changed 2020-01-17 19:48:24 +01:00
hsr_device.c net: hsr: Reset MAC header for Tx path 2021-04-14 08:24:12 +02:00
hsr_device.h hsr: switch ->dellink() to ->ndo_uninit() 2019-07-11 14:37:45 -07:00
hsr_forward.c net: hsr: Fix potential use-after-free 2022-12-08 11:23:03 +01:00
hsr_forward.h net: hsr: convert to SPDX identifier 2019-04-06 18:32:21 -07:00
hsr_framereg.c hsr: Fix uninit-value access in hsr_get_node() 2024-03-26 18:22:24 -04:00
hsr_framereg.h hsr: Avoid double remove of a node. 2023-01-18 11:41:09 +01:00
hsr_main.c hsr: Handle failures in module init 2024-03-26 18:22:25 -04:00
hsr_main.h hsr: Fix a compilation error 2020-01-29 16:45:30 +01:00
hsr_netlink.c hsr: check protocol version in hsr_newlink() 2020-04-21 09:04:44 +02:00
hsr_netlink.h net: hsr: convert to SPDX identifier 2019-04-06 18:32:21 -07:00
hsr_slave.c hsr: fix general protection fault in hsr_addr_is_self() 2020-04-01 11:01:31 +02:00
hsr_slave.h net: hsr: convert to SPDX identifier 2019-04-06 18:32:21 -07:00