Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4618399pxj; Wed, 12 May 2021 09:21:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIC8fen7iJwXpSYMceqlyZEy8t/TDUPgtNx5KPSLSzpZq1VASuK83+AcAlgRrnrApYR7GK X-Received: by 2002:a05:6402:1354:: with SMTP id y20mr44768200edw.115.1620836465401; Wed, 12 May 2021 09:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836465; cv=none; d=google.com; s=arc-20160816; b=fGF6hf3gJ+FqS0zgfBPBzbcSLe4PUy3rPYLQpEuJ3Bq5W7/kYguiTxy3P6jgRjBhDg gFUydSF9pX/+gCkF5+oMhIptsNVXig48IednGhXv5flm6uZQvXkwGNtfjMgTYMUGxTxf BxXkfPC7J5Zq5xe8qfogDTlPsj9wMK7cmAFzXumA14ZVkJbEGqTv+hvz6Kvw3x+a9EvO IDmrkuZZsp0UmuKkfocR5ut3IMzJx1QQyYItdWWGgfbh+unD3FljQu04d35PuwhhAhDH ur1o5geiT+fR1ObdA8H9c+sFbTZ/TqAuMi3VMlKKrGwFvZj8Esbc4H3+gWt7FgNZ9yRn uFWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AkJw6sm4w85q5Cp8N6nnTGFjh5/xU27OslsAhNqPjYw=; b=D+C2prud9NH6SDih6Vrn21xOCWkzzg7FV8jIOSWhxXHE6s/enGpwx2GfIN/UKtvyPW CRwV1dNT3qM9f/pC3boGFQibZ/69CwBZ3wCD/fBvLyCS0md5+gWTvjwlq56k8Qpz6Ncy k7X8PwTrn92OX8kYD4SKidcNb744Df0weY2CX3wMjKbINmtz5QLNI1xRWnXiXgx8awPd ZW0rw7LjnubA6sJ/nlirUpOzIOgkvKg3NtvHkOtoF8ExllHxUzoPP9YHk6HGRJVHmJmY IUDezSNa8KvxNxZLkpBk7adZiyzKt0KgQHR7l2fFARvn+u3AJzi4JNAdJWumXaiI/Lvo rNPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TNFpZ9dU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b10si250901eje.471.2021.05.12.09.20.41; Wed, 12 May 2021 09:21:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TNFpZ9dU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233807AbhELQTH (ORCPT + 99 others); Wed, 12 May 2021 12:19:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:55348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235794AbhELPgD (ORCPT ); Wed, 12 May 2021 11:36:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 055FB61C3A; Wed, 12 May 2021 15:18:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832685; bh=tqYKzZCh4SWAyuqWLZ6JZo96wNFd1JHdJX52HyHsvAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TNFpZ9dUGqcVvYyUEXGUS7+JS2GLOH7Hg32fOXCtB5xJodNRY4yVhy+EjEchLYeuv 9CEe0HDRujR/swSPYsFIC+5P6b9O66KyCbak7JOymlR9wxfdMkzhd1rdSM7lQKAtTZ hB5nYcaoyjhh+R0v6YHNTH1X1gqZ96is9/hfTL/w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Yang Yingliang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 382/530] net/tipc: fix missing destroy_workqueue() on error in tipc_crypto_start() Date: Wed, 12 May 2021 16:48:12 +0200 Message-Id: <20210512144832.327381466@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yang Yingliang [ Upstream commit ac1db7acea67777be1ba86e36e058c479eab6508 ] Add the missing destroy_workqueue() before return from tipc_crypto_start() in the error handling case. Fixes: 1ef6f7c9390f ("tipc: add automatic session key exchange") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/tipc/crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c index 86eb6d679225..2301b66280de 100644 --- a/net/tipc/crypto.c +++ b/net/tipc/crypto.c @@ -1485,6 +1485,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; } -- 2.30.2