From patchwork Tue Sep 29 11:01:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 291103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8125C4741F for ; Tue, 29 Sep 2020 11:43:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8857A20702 for ; Tue, 29 Sep 2020 11:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379836; bh=LoAXF5XTR4w9T6a3sMyjEc6yieQF+GoGSbOwzvnNPLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SdZSER/zLQ5bCcRky54Uy/gObqpY1A1bbxbz+0Aktd5ytIsMlJiv+j+W/0+wtyEyD mtqthEYpTL65PsL3Ascf9eTC6W1LR8Nj/gIQjVpgWuY6tHPlHU4XlH7xC1i+HNyVsE EF5Yso5wVHXEItFVE8h9Z7QGpg58fIPcCr8OSNPE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730823AbgI2Lnz (ORCPT ); Tue, 29 Sep 2020 07:43:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:42506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730821AbgI2Lnx (ORCPT ); Tue, 29 Sep 2020 07:43:53 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 79F7B206E5; Tue, 29 Sep 2020 11:43:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379833; bh=LoAXF5XTR4w9T6a3sMyjEc6yieQF+GoGSbOwzvnNPLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rWn9hdh+3Q/WXjgb8c9C+FoZN3Es4qR38ziFGuy3EFKbaRapwfjrztDAwcz8fyiI5 KF03xAb9zr2ReNCBGGgGdgu6jXMEuZiqcFVHE3dmp47KdYvg8k45xddMFJ6vwnayzI 5HHGoAmJxRPPepsX2ltICwQF1b6vIDqrQK/dxOEE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liu Jian , Stefan Schmidt , Sasha Levin Subject: [PATCH 5.4 337/388] ieee802154: fix one possible memleak in ca8210_dev_com_init Date: Tue, 29 Sep 2020 13:01:08 +0200 Message-Id: <20200929110026.776642274@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929110010.467764689@linuxfoundation.org> References: <20200929110010.467764689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Liu Jian [ Upstream commit 88f46b3fe2ac41c381770ebad9f2ee49346b57a2 ] We should call destroy_workqueue to destroy mlme_workqueue in error branch. Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver") Signed-off-by: Liu Jian Link: https://lore.kernel.org/r/20200720143315.40523-1-liujian56@huawei.com Signed-off-by: Stefan Schmidt Signed-off-by: Sasha Levin --- drivers/net/ieee802154/ca8210.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index 430c937861534..25dbea302fb6d 100644 --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -2924,6 +2924,7 @@ static int ca8210_dev_com_init(struct ca8210_priv *priv) ); if (!priv->irq_workqueue) { dev_crit(&priv->spi->dev, "alloc of irq_workqueue failed!\n"); + destroy_workqueue(priv->mlme_workqueue); return -ENOMEM; }