Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1739903rdb; Wed, 20 Sep 2023 19:44:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHkbo6r+ggLKvXpG5BD0xTwxA1Ef8rUlo4fiziLYFHGMBqDk/X5uPSoNhwoTtlfNvRKClbo X-Received: by 2002:a05:6a20:748e:b0:152:375d:ceea with SMTP id p14-20020a056a20748e00b00152375dceeamr4803958pzd.15.1695264274564; Wed, 20 Sep 2023 19:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695264274; cv=none; d=google.com; s=arc-20160816; b=MxPOiH3ML9EVjcn0WI7sggeAP2T494gxPE9wcCjf2H2cGjbvW3WvtKfC+zfjJP/z6Q mc5zywMANXZj1ZCN/Sa0rOuIlBH0dvhvL8x4MUlUsOBx06hmoe1y9P+IV60fPx+njG1y +2THng3KChOSo+OEsd2fan8vAXX3xw9KifpFDxkF8BNhvqAtyVRV07r1Nxp5m2C7EY3J tymHteVVqjjNrHM1nBgt4cxWHCbdP0XmjJ+t6XoyfnU5MeIuiDcb5c0DF+VglXi0H3/y pXx8llTCfW0AiLDBAyLNxpUmhOV2MqwmsD6Ert9ugOdOnm6B9dJaUbnH1uyqCNJRupWN eCUA== 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=5ilkUYTWpqLumWaeXuBnrZbXLwb/7aN2BHh9/Zs0PRs=; fh=VK4GYMBebvMQCrcu2n2Zae3yc77oFdyfZTM6QfHDfeY=; b=kLKs7FRZpL6eGtbZ5LbagRbs30PRcbg/BhDA+G25jEivMy50x9FBqR/fwpFHKKBNKN 1F8t/PteuYErI/Ecq5MBnvi8UAIZM8d4n27wajkuPKVfyYepkWyHNnFVbB/JxSwyJn+O XcnKYdQE6HEHTiLa5jX0FNsiuZVm5KUuqljTSCmcWAglqlC4DROJ8HB3+anosl66HG9i iKk7odPCcdm12VNaL/95YRS/D6zELrBL9hujTx+lC1CICYQr274R518i2S70PeJhjetK jH/t8BRWKR7h+WjUGE4rAagmfj10FRGhnwk/Tiqms5LJekXr6iJ9mvRuhlr7dBysKqcy PjLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id ce11-20020a056a002a0b00b00690f9ca0f99si484442pfb.12.2023.09.20.19.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 19:44:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 65EBF825E48D; Wed, 20 Sep 2023 19:44:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbjIUCoW (ORCPT + 99 others); Wed, 20 Sep 2023 22:44:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbjIUCoV (ORCPT ); Wed, 20 Sep 2023 22:44:21 -0400 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B49FE102; Wed, 20 Sep 2023 19:44:13 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 38L2hQsB025108; Thu, 21 Sep 2023 10:43:26 +0800 (+08) (envelope-from Chunyan.Zhang@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4Rrfkt1GZQz2SCXQ3; Thu, 21 Sep 2023 10:40:06 +0800 (CST) Received: from ubt.spreadtrum.com (10.0.73.70) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 21 Sep 2023 10:43:24 +0800 From: Chunyan Zhang To: Pavel Machek , Lee Jones CC: , Baolin Wang , Orson Zhai , Chunyan Zhang , Chunyan Zhang , LKML Subject: [PATCH] leds: sc27xx: Add a missing mutex_destory() Date: Thu, 21 Sep 2023 10:43:14 +0800 Message-ID: <20230921024314.615370-1-chunyan.zhang@unisoc.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.0.73.70] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 38L2hQsB025108 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 20 Sep 2023 19:44:32 -0700 (PDT) In sc27xx_led_probe() there's one error branch missing mutex_destory() after mutex_init(), it seems that we should add it since other branches which follow it called mutex_destoy() before return failure. Fixes: e081c49e30ec ("leds: Add Spreadtrum SC27xx breathing light controller driver") Signed-off-by: Chunyan Zhang --- drivers/leds/leds-sc27xx-bltc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/leds/leds-sc27xx-bltc.c b/drivers/leds/leds-sc27xx-bltc.c index e199ea15e406..122094bbf444 100644 --- a/drivers/leds/leds-sc27xx-bltc.c +++ b/drivers/leds/leds-sc27xx-bltc.c @@ -300,6 +300,7 @@ static int sc27xx_led_probe(struct platform_device *pdev) priv->base = base; priv->regmap = dev_get_regmap(dev->parent, NULL); if (!priv->regmap) { + mutex_destroy(&priv->lock); err = -ENODEV; dev_err(dev, "failed to get regmap: %d\n", err); return err; -- 2.41.0