From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>,
Pavel Machek <pavel@ucw.cz>, Dan Murphy <dmurphy@ti.com>,
linux-leds@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] led: triggers: Fix NULL dereference in led_trigger_set() error handling
Date: Thu, 5 Sep 2019 14:06:26 +0200 [thread overview]
Message-ID: <20190905120626.hyegecmy6hf5lvhj@pengutronix.de> (raw)
In-Reply-To: <20190905095728.GA26005@mwanda>
Hello,
On Thu, Sep 05, 2019 at 12:57:28PM +0300, Dan Carpenter wrote:
> The problem is we set "led_cdev->trigger = NULL;" and then dereference
> it when we call write_lock_irqsave():
>
> write_lock_irqsave(&led_cdev->trigger->leddev_list_lock, flags);
> ^^^^^^^^^^^^^^^^^
>
> Fixes: 2282e125a406 ("leds: triggers: let struct led_trigger::activate() return an error code")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Obviously right. Thanks for catching.
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Did you find this at runtime or by using some static checker?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2019-09-05 12:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 9:57 [PATCH] led: triggers: Fix NULL dereference in led_trigger_set() error handling Dan Carpenter
2019-09-05 11:22 ` Oleh Kravchenko
2019-09-05 12:06 ` Uwe Kleine-König [this message]
2019-09-05 12:23 ` Oleh Kravchenko
2019-09-05 12:46 ` Uwe Kleine-König
2019-09-05 20:41 ` Jacek Anaszewski
2019-09-05 13:32 ` Dan Carpenter
2019-09-08 9:46 ` Oleh Kravchenko
2019-09-05 12:39 ` Oleh Kravchenko
2019-09-05 13:04 ` Dan Carpenter
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=20190905120626.hyegecmy6hf5lvhj@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=dan.carpenter@oracle.com \
--cc=dmurphy@ti.com \
--cc=jacek.anaszewski@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/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;
as well as URLs for NNTP newsgroup(s).