Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp267086rwn; Fri, 16 Sep 2022 20:08:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7+fRNv20KLPwQ8HhxOT9sN1rdQ5/u5Rs2k+2ekemXDDEUGvZKev7KtcaGsbCqzgaxTOob2 X-Received: by 2002:aa7:d9d5:0:b0:453:8328:85c with SMTP id v21-20020aa7d9d5000000b004538328085cmr2843472eds.308.1663384104811; Fri, 16 Sep 2022 20:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663384104; cv=none; d=google.com; s=arc-20160816; b=nBBgyIhZlUNbVsTdtipDqIoWmd/y0ECYiP+ZHJ05Dg50PeotcnAZKFAhi0BfAF2Bg3 lXGqKU2IY+N6+z0gMJFAgy8y6wf2r0mCMDVlj5e+0W+0FAAjvjxtR4iqc7+/L9IWtlk4 +lDZOfB1i+nxykskhUbfNP6mgRXAqRh/G5yZ2xXj20qn+4HJEPku6aHcUFn9LbFtADI6 SQ6x34ZSEcRCOf9pP8xxTo3j/kiAv5Df0Q9e4Cu462X0ZQSgTkXX2K8qXvHJxxHsAKga Q6za2nYdF10Fqt/65ZR2XztPHpwdvLcs2In86K634QOsT2MqUwqCSF4uTE7rb757D0oD rVRQ== 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 :message-id:date:subject:cc:to:from; bh=9MNbth5Qje0lvbu9HY3eh2Y//owjXL3jyA9gnGTkHf4=; b=OGfaXQzvGwX9CfpbIZgaCcOFJyQqFU92IUhNS7ucg/fU/Eo8iL0uzfelRSLPLYEse1 mEEv8pBkKokxHfZriSMMV5ejWEiwYa1O/aVnAt7jMk6wYsIGWf9p8n9dRfN5dIGAHujd xokNmIlrfRwyt8u75kLNyf3FtnRh/pKywKXEj7uF3498a7TWnyItyiYMVMyqsWEbKC4Z IuX5AI20wFvaIWkVLjb7aNWSl6uDCDGzCEYFCJC28aO9jw5TdvsEaHze7GdE08PveoeM PuzyJ55BihOUMIXjDzsQw327gH7HaToRhqLA0QPjiebyV950kUG8eBhKOT3a7U92KDHq i1Wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a50d485000000b004526ddc4e9asi3623437edi.478.2022.09.16.20.07.58; Fri, 16 Sep 2022 20:08:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229553AbiIQCjg (ORCPT + 99 others); Fri, 16 Sep 2022 22:39:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiIQCjc (ORCPT ); Fri, 16 Sep 2022 22:39:32 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B5C625B; Fri, 16 Sep 2022 19:39:27 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MTw5z6yt1zmVGd; Sat, 17 Sep 2022 10:35:35 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 17 Sep 2022 10:39:25 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 17 Sep 2022 10:39:24 +0800 From: Yang Yingliang To: , CC: , , Subject: [PATCH -next v2 1/2] pinctrl: ocelot: add missing destroy_workqueue() in error path in ocelot_pinctrl_probe() Date: Sat, 17 Sep 2022 10:46:33 +0800 Message-ID: <20220917024634.1021861-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the missing destroy_workqueue() before return from ocelot_pinctrl_probe() in error path. Fixes: c297561bc98a ("pinctrl: ocelot: Fix interrupt controller") Signed-off-by: Yang Yingliang --- v2: move alloc_ordered_workqueue() after ocelot_pinctrl_register(). --- drivers/pinctrl/pinctrl-ocelot.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c index d9c0184c077f..c672bc2a4df5 100644 --- a/drivers/pinctrl/pinctrl-ocelot.c +++ b/drivers/pinctrl/pinctrl-ocelot.c @@ -2065,10 +2065,6 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) if (!info->desc) return -ENOMEM; - info->wq = alloc_ordered_workqueue("ocelot_ordered", 0); - if (!info->wq) - return -ENOMEM; - info->pincfg_data = &data->pincfg_data; reset = devm_reset_control_get_optional_shared(dev, "switch"); @@ -2107,9 +2103,15 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) if (ret) return ret; + info->wq = alloc_ordered_workqueue("ocelot_ordered", 0); + if (!info->wq) + return -ENOMEM; + ret = ocelot_gpiochip_register(pdev, info); - if (ret) + if (ret) { + destroy_workqueue(info->wq); return ret; + } dev_info(dev, "driver registered\n"); -- 2.25.1