From: Jakub Kicinski Date: Tue, 3 Sep 2019 04:31:06 +0000 (-0700) Subject: net/tls: dedup the record cleanup X-Git-Tag: v5.4-rc1~131^2~83^2 X-Git-Url: http://git.samba.org/samba.git/?a=commitdiff_plain;h=6e3d02b670eafce69aa64457b87c3b17ff216d23;p=sfrench%2Fcifs-2.6.git net/tls: dedup the record cleanup If retransmit record hint fall into the cleanup window we will free it by just walking the list. No need to duplicate the code. Signed-off-by: Jakub Kicinski Reviewed-by: John Hurley Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller --- diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index 9e1bec1a0a28..41c106e45f01 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -159,12 +159,8 @@ static void tls_icsk_clean_acked(struct sock *sk, u32 acked_seq) spin_lock_irqsave(&ctx->lock, flags); info = ctx->retransmit_hint; - if (info && !before(acked_seq, info->end_seq)) { + if (info && !before(acked_seq, info->end_seq)) ctx->retransmit_hint = NULL; - list_del(&info->list); - destroy_record(info); - deleted_records++; - } list_for_each_entry_safe(info, temp, &ctx->records_list, list) { if (before(acked_seq, info->end_seq))