diff options
author | Tariq Toukan <tariqt@nvidia.com> | 2022-07-14 10:07:54 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-21 22:20:13 +0300 |
commit | c713de1d80a5d7035dc7f667b485bded83b4e74a (patch) | |
tree | 98c5a45f658ddd09d07a03e46bba8864fd8bb5af /net/tls | |
parent | eb58fd350a851b5cda9f4c9a2cefb15c7ccf33f3 (diff) | |
download | linux-c713de1d80a5d7035dc7f667b485bded83b4e74a.tar.xz |
net/tls: Check for errors in tls_device_init
[ Upstream commit 3d8c51b25a235e283e37750943bbf356ef187230 ]
Add missing error checks in tls_device_init.
Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure")
Reported-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://lore.kernel.org/r/20220714070754.1428-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/tls')
-rw-r--r-- | net/tls/tls_device.c | 4 | ||||
-rw-r--r-- | net/tls/tls_main.c | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index 3c82286e5bcc..6ae2ce411b4b 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -1390,9 +1390,9 @@ static struct notifier_block tls_dev_notifier = { .notifier_call = tls_dev_event, }; -void __init tls_device_init(void) +int __init tls_device_init(void) { - register_netdevice_notifier(&tls_dev_notifier); + return register_netdevice_notifier(&tls_dev_notifier); } void __exit tls_device_cleanup(void) diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index 58d22d6b86ae..e537085b184f 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -905,7 +905,12 @@ static int __init tls_register(void) if (err) return err; - tls_device_init(); + err = tls_device_init(); + if (err) { + unregister_pernet_subsys(&tls_proc_ops); + return err; + } + tcp_register_ulp(&tcp_tls_ulp_ops); return 0; |