Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2278082rdb; Thu, 21 Sep 2023 13:50:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3w0o2iYNzPWGmHu7wN9F+JD/r7UHiOPpOJbs3IulDCyPBywQzZpU53l9go63EdORPn7Ux X-Received: by 2002:a17:902:e851:b0:1c4:50fd:7cd1 with SMTP id t17-20020a170902e85100b001c450fd7cd1mr6509185plg.11.1695329453707; Thu, 21 Sep 2023 13:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695329453; cv=none; d=google.com; s=arc-20160816; b=Up0vpvW76Sb9/2gkjUzbqSkjAWUsc80s3EteaMn1IL5aItxadiTO/B57d/IEszN+T2 iaOZeZKAG4ECse/kpefLMPOjB2Hdlff48Xioq5TkP4PJ+KLuIjo5Hess/DFjqd2Euwef +NK+laNHyLHfWOZ4fXHph1HVfFs/l9VnwuTEaEiGk8c7juosAwXHIuAsT+iNBSiNPnEJ eyZcgbGgH/YD82xlP3FzUNMm1NE/JcoboO/zOEwM4bskQCpKjRWYRjPmL3+UxA1Ntv2h APedreWOIeI/H3TYVIMRXW2C3u1IF6H1EJ6tMbCFlDXIgd0vFQ5Gow3u3JurUQ6QuhSd p7iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4yf8Y2oH6TQVhe61iMRWfEHLCbpmhO06at947GcPjPY=; fh=L0tXFvleOe6ZMN96W/omzutIpuOhoHq++Or8n09icX0=; b=RUOTLkmanWYVdIN4FFLdOHejARhOXsAZ1sebSLVI5g2hO3fPjUHKfYHYfqk+LBYV5V XbN86e/2dH6BCwTd5BsxLiRjiPYluu++yDn4l7F9QgK8mt12ALc9JRBxksLm2bp/b2sJ 5GZ82Iuf+HrNjGOd5sz5IlL+2XAdSzVTUWoaVjibnEVCNM9sDy9Hu+XhGbZSae4QzRAK gn6w7dSUAfqbXrTZfNLubYjNqMibIud2qaY0bHqAJ90wkG4UyEMfpi28snI9g8d9mMlE ovd9jlx8SRbfFyy8S044iFkQo3pd2M/TG7NdZvdEQ9acGfhATOhJv0SnZQeFB7jjQ4cg 89NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ok/dWXRP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id s3-20020a170902ea0300b001bdb34b67basi2402403plg.369.2023.09.21.13.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 13:50:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ok/dWXRP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id CB77E802A3C8; Thu, 21 Sep 2023 13:38:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232245AbjIUUh7 (ORCPT + 99 others); Thu, 21 Sep 2023 16:37:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232138AbjIUUhb (ORCPT ); Thu, 21 Sep 2023 16:37:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61C9085D0A; Thu, 21 Sep 2023 10:37:47 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E76E7C4AF7F; Thu, 21 Sep 2023 12:05:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695297950; bh=MIAPvm2D9dsEYNFzb9MK6Q/J1mLxxDhkVeMPqNpuQBA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ok/dWXRP9v159kkOVgc53JH6vyyUhzV3W+r6S3w/1w8QLcDNkW69KJVswMQB/M9oE wh+RcUcW32Sjce2VvVCNyDevZ8UCjUnSGDg8VnAKjh3SiqW+neZyGIO/Z7KKysMG8m ecvUHb/QqzURDC0OWJzkM10DSFGcx0Gvn7g6TCb0WuTRpGsq/w8op3H2dmZgyOOsMI 9Y0l12npuO7ZDU0WjCzWpGnR78dPlE3Bo9CwHA/wi7HyI/eTkFkAO+S/PDWNUvHN4J h0uVDnj8m0TxnI6LDE+kTDdvNhNIfRtP1uFtSe8k95zKF6Blh3g0cMVTLOjUfCVbmp LnqNneqNG4epA== Date: Thu, 21 Sep 2023 13:05:46 +0100 From: Lee Jones To: Chunyan Zhang Cc: Pavel Machek , linux-leds@vger.kernel.org, Baolin Wang , Orson Zhai , Chunyan Zhang , LKML Subject: Re: [PATCH] leds: sc27xx: Add a missing mutex_destory() Message-ID: <20230921120546.GI3449785@google.com> References: <20230921024314.615370-1-chunyan.zhang@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230921024314.615370-1-chunyan.zhang@unisoc.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 21 Sep 2023 13:38:11 -0700 (PDT) On Thu, 21 Sep 2023, Chunyan Zhang wrote: > 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. Wouldn't it be better to move the mutex_init() to the end of .probe()? > 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 > -- Lee Jones [李琼斯]