Skip to content

Commit

Permalink
net/tipc: fix missing destroy_workqueue() on error in tipc_crypto_sta…
Browse files Browse the repository at this point in the history
…rt()

Add the missing destroy_workqueue() before return from
tipc_crypto_start() in the error handling case.

Fixes: 1ef6f7c ("tipc: add automatic session key exchange")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yang Yingliang authored and David S. Miller committed Mar 31, 2021
1 parent ab1b4f0 commit ac1db7a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/tipc/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,8 @@ int tipc_crypto_start(struct tipc_crypto **crypto, struct net *net,
/* Allocate statistic structure */
c->stats = alloc_percpu_gfp(struct tipc_crypto_stats, GFP_ATOMIC);
if (!c->stats) {
if (c->wq)
destroy_workqueue(c->wq);
kfree_sensitive(c);
return -ENOMEM;
}
Expand Down

0 comments on commit ac1db7a

Please sign in to comment.