From nobody Fri Dec 19 16:06:54 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD77FCD493F for ; Thu, 21 Sep 2023 02:44:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229630AbjIUCoX (ORCPT ); Wed, 20 Sep 2023 22:44:23 -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: quoted-printable 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 controlle= r 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-blt= c.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 *pde= v) priv->base =3D base; priv->regmap =3D dev_get_regmap(dev->parent, NULL); if (!priv->regmap) { + mutex_destroy(&priv->lock); err =3D -ENODEV; dev_err(dev, "failed to get regmap: %d\n", err); return err; --=20 2.41.0