linux-stable/net/hsr
Felix Maurer 87ca3d940f 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:21:00 -04:00
..
Kconfig hsr: enhance netlink socket interface to support PRP 2020-07-27 12:20:40 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
hsr_debugfs.c Revert "net: hsr: use hlist_head instead of list_head for mac addresses" 2022-12-31 13:32:21 +01:00
hsr_device.c net: hsr: remove WARN_ONCE() in send_hsr_supervision_frame() 2024-02-23 09:12:37 +01:00
hsr_device.h net: hsr: add offloading support 2021-02-11 13:24:44 -08:00
hsr_forward.c net: hsr: Use correct offset for HSR TLV values in supervisory HSR frames 2024-03-06 14:45:08 +00:00
hsr_forward.h net: hsr: fix mac_len checks 2021-05-24 14:10:28 -07:00
hsr_framereg.c hsr: Fix uninit-value access in hsr_get_node() 2024-03-26 18:20:59 -04:00
hsr_framereg.h hsr: Synchronize sequence number updates. 2022-12-31 13:32:22 +01:00
hsr_main.c hsr: Handle failures in module init 2024-03-26 18:21:00 -04:00
hsr_main.h net: hsr: Add __packed to struct hsr_sup_tlv. 2023-10-06 14:56:57 +02:00
hsr_netlink.c Revert "net: hsr: use hlist_head instead of list_head for mac addresses" 2022-12-31 13:32:21 +01:00
hsr_netlink.h hsr: enhance netlink socket interface to support PRP 2020-07-27 12:20:40 -07:00
hsr_slave.c net: hsr: fix mac_len checks 2021-05-24 14:10:28 -07:00
hsr_slave.h net: prp: add packet handling support 2020-07-27 12:20:40 -07:00