summaryrefslogtreecommitdiffstats
path: root/net/tls/tls_device.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-07-29 03:21:16 +0200
committerJakub Kicinski <kuba@kernel.org>2022-07-29 03:21:16 +0200
commit272ac32f566e3f925b20c231a2b30f6893aa258a (patch)
treec7c04a13d89349f0d007914904347df79438f3fa /net/tls/tls_device.c
parentnet: cdns,macb: use correct xlnx prefix for Xilinx (diff)
parentMerge tag 'net-5.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/n... (diff)
downloadlinux-272ac32f566e3f925b20c231a2b30f6893aa258a.tar.xz
linux-272ac32f566e3f925b20c231a2b30f6893aa258a.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/tls/tls_device.c')
-rw-r--r--net/tls/tls_device.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index fc513c1806a0..b3e2a30041c6 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -1383,8 +1383,13 @@ static int tls_device_down(struct net_device *netdev)
* by tls_device_free_ctx. rx_conf and tx_conf stay in TLS_HW.
* Now release the ref taken above.
*/
- if (refcount_dec_and_test(&ctx->refcount))
+ if (refcount_dec_and_test(&ctx->refcount)) {
+ /* sk_destruct ran after tls_device_down took a ref, and
+ * it returned early. Complete the destruction here.
+ */
+ list_del(&ctx->list);
tls_device_free_ctx(ctx);
+ }
}
up_write(&device_offload_lock);