File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -704,7 +704,7 @@ int tls_sw_fallback_init(struct sock *sk,
704
704
struct tls_crypto_info * crypto_info );
705
705
706
706
#ifdef CONFIG_TLS_DEVICE
707
- void tls_device_init (void );
707
+ int tls_device_init (void );
708
708
void tls_device_cleanup (void );
709
709
void tls_device_sk_destruct (struct sock * sk );
710
710
int tls_set_device_offload (struct sock * sk , struct tls_context * ctx );
@@ -724,7 +724,7 @@ static inline bool tls_is_sk_rx_device_offloaded(struct sock *sk)
724
724
return tls_get_ctx (sk )-> rx_conf == TLS_HW ;
725
725
}
726
726
#else
727
- static inline void tls_device_init (void ) {}
727
+ static inline int tls_device_init (void ) { return 0 ; }
728
728
static inline void tls_device_cleanup (void ) {}
729
729
730
730
static inline int
Original file line number Diff line number Diff line change @@ -1419,9 +1419,9 @@ static struct notifier_block tls_dev_notifier = {
1419
1419
.notifier_call = tls_dev_event ,
1420
1420
};
1421
1421
1422
- void __init tls_device_init (void )
1422
+ int __init tls_device_init (void )
1423
1423
{
1424
- register_netdevice_notifier (& tls_dev_notifier );
1424
+ return register_netdevice_notifier (& tls_dev_notifier );
1425
1425
}
1426
1426
1427
1427
void __exit tls_device_cleanup (void )
Original file line number Diff line number Diff line change @@ -1048,7 +1048,12 @@ static int __init tls_register(void)
1048
1048
if (err )
1049
1049
return err ;
1050
1050
1051
- tls_device_init ();
1051
+ err = tls_device_init ();
1052
+ if (err ) {
1053
+ unregister_pernet_subsys (& tls_proc_ops );
1054
+ return err ;
1055
+ }
1056
+
1052
1057
tcp_register_ulp (& tcp_tls_ulp_ops );
1053
1058
1054
1059
return 0 ;
You can’t perform that action at this time.
0 commit comments