File tree 1 file changed +4
-7
lines changed 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -248,16 +248,13 @@ static void tls_sk_proto_close(struct sock *sk, long timeout)
248
248
struct tls_context * ctx = tls_get_ctx (sk );
249
249
long timeo = sock_sndtimeo (sk , 0 );
250
250
void (* sk_proto_close )(struct sock * sk , long timeout );
251
+ bool free_ctx = false;
251
252
252
253
lock_sock (sk );
253
254
sk_proto_close = ctx -> sk_proto_close ;
254
255
255
- if (ctx -> conf == TLS_HW_RECORD )
256
- goto skip_tx_cleanup ;
257
-
258
- if (ctx -> conf == TLS_BASE ) {
259
- kfree (ctx );
260
- ctx = NULL ;
256
+ if (ctx -> conf == TLS_BASE || ctx -> conf == TLS_HW_RECORD ) {
257
+ free_ctx = true;
261
258
goto skip_tx_cleanup ;
262
259
}
263
260
@@ -294,7 +291,7 @@ static void tls_sk_proto_close(struct sock *sk, long timeout)
294
291
/* free ctx for TLS_HW_RECORD, used by tcp_set_state
295
292
* for sk->sk_prot->unhash [tls_hw_unhash]
296
293
*/
297
- if (ctx && ctx -> conf == TLS_HW_RECORD )
294
+ if (free_ctx )
298
295
kfree (ctx );
299
296
}
300
297
You can’t perform that action at this time.
0 commit comments