mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chunyan Zhang <chunyan.zhang@unisoc.com>
To: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>
Cc: <linux-leds@vger.kernel.org>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Orson Zhai <orsonzhai@gmail.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Chunyan Zhang <chunyan.zhang@unisoc.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] leds: sc27xx: Add a missing mutex_destory()
Date: Thu, 21 Sep 2023 10:43:14 +0800	[thread overview]
Message-ID: <20230921024314.615370-1-chunyan.zhang@unisoc.com> (raw)

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 <chunyan.zhang@unisoc.com>
---
 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


             reply	other threads:[~2023-09-21  2:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21  2:43 Chunyan Zhang [this message]
2023-09-21 12:05 ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230921024314.615370-1-chunyan.zhang@unisoc.com \
    --to=chunyan.zhang@unisoc.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®