Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4876179pjb; Mon, 27 Jul 2020 07:22:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJya1qEKFP9L3pb/M6pvi1f1pjdLuWauI3CBEH4OcUhVEpTwdpCvdsGfvcaJoXBYJo9Pn2y0 X-Received: by 2002:a50:a6da:: with SMTP id f26mr11196552edc.4.1595859778233; Mon, 27 Jul 2020 07:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859778; cv=none; d=google.com; s=arc-20160816; b=qspwsh3M1xs+l/96SCQ0bc4E/tQ70AQs30XQu4f3Gk1tFs49zLN0Thk9TgPzXyc9ZC DXx0sImGbTzRq1/kNO46DS1lZ+hyIoAjcIIpyit041cfjOqn2sveIIr04k8sXIa2630E 2b6V8r1wX/6mbfF1oXGZ9YOCHgJ8gtLZ3VGUXgtOB3sF3kkTLjoyJyxgkAE44VZylVlE 3xveFdT/IxxAMC1FTGiZeAIzjTjr5ivh/mgguCf4RWSQ/56XmSkCHV7rTL9CuG/xBk4E g1DUDqyreBOdru84vz+qFBPChZAXkJlsNQQkSdK3FQ0rwehhy7Llggwk4iTug3tOZicN cOSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hbTg27/NjejXIUNQQqrRFbPIKleENwk+gNVo3mm3duA=; b=CBpntboHJ+feWKuCZRQjl2CgJf/qc+pFOSQfPFfxaOiaopQyqtJqTF98GI2br3VIQR L2jmvPum4h/wGQMRMz7PrBGbNiLM2Il3Ezt9tiKHHx+eXTCcwaO+cTsCfo+8zPlO/rwP D0I1X3WdddjvvXahXwozpn58vsYI9hLRB+uTApcT0EvmAUIlg43a9BjUltHepimL3qh/ FTq7+mZOAd5NukRnESVZx16VRuEqyL5/XSfrg2w4HIPlTzTQ7XYVSwQo3NHTfPq/VPZT vqd745MFHsfdruvfeXpYddd49yvCNfLB8fVHnxPRfOlovac0pbfxpfIbtUUF5NVsUYhQ n+ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PKupiYhc; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si6927308edl.120.2020.07.27.07.22.35; Mon, 27 Jul 2020 07:22:58 -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=@kernel.org header.s=default header.b=PKupiYhc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731674AbgG0OVI (ORCPT + 99 others); Mon, 27 Jul 2020 10:21:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:49638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731638AbgG0OVH (ORCPT ); Mon, 27 Jul 2020 10:21:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F6C22070A; Mon, 27 Jul 2020 14:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859666; bh=XQDfGytVTpKeb+agTuSXemU8hW+k5+3VzA9zL6czwig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PKupiYhceYfqkN7aiWz7u4BtA9LJj1hp5mUgv9FBn9/JviRa0NAkUogzGLBWwSP74 yxk7CE8stMMqaInIo3A1sgl4P4ZJ+6DhKGa1LGaOGD9MFzB02ruAVozM6MBRV7KP3W 1FM9Epa/2SVdacz92E2jw3ihdMMo9xTI4JpqLofg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liu Jian , Michael Hennerich , Stefan Schmidt , Sasha Levin Subject: [PATCH 5.7 059/179] ieee802154: fix one possible memleak in adf7242_probe Date: Mon, 27 Jul 2020 16:03:54 +0200 Message-Id: <20200727134935.545552337@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liu Jian [ Upstream commit 66673f96f0f968b991dc38be06102246919c663c ] When probe fail, we should destroy the workqueue. Fixes: 2795e8c25161 ("net: ieee802154: fix a potential NULL pointer dereference") Signed-off-by: Liu Jian Acked-by: Michael Hennerich Link: https://lore.kernel.org/r/20200717090121.2143-1-liujian56@huawei.com Signed-off-by: Stefan Schmidt Signed-off-by: Sasha Levin --- drivers/net/ieee802154/adf7242.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c index 5a37514e42347..8dbccec6ac866 100644 --- a/drivers/net/ieee802154/adf7242.c +++ b/drivers/net/ieee802154/adf7242.c @@ -1262,7 +1262,7 @@ static int adf7242_probe(struct spi_device *spi) WQ_MEM_RECLAIM); if (unlikely(!lp->wqueue)) { ret = -ENOMEM; - goto err_hw_init; + goto err_alloc_wq; } ret = adf7242_hw_init(lp); @@ -1294,6 +1294,8 @@ static int adf7242_probe(struct spi_device *spi) return ret; err_hw_init: + destroy_workqueue(lp->wqueue); +err_alloc_wq: mutex_destroy(&lp->bmux); ieee802154_free_hw(lp->hw); -- 2.25.1