From: Dirk Behme <dirk.behme@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
Linux PM list <linux-pm@vger.kernel.org>,
Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>
Cc: Dirk Behme <dirk.behme@de.bosch.com>,
linux-renesas-soc@vger.kernel.org,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: Re: [PATCH] thermal: rcar_thermal: Fix priv->zone error handling
Date: Tue, 3 May 2016 19:46:22 +0200 [thread overview]
Message-ID: <5728E3EE.6030506@gmail.com> (raw)
In-Reply-To: <CAMuHMdWDnHDrf8d1nY0M6bY_z1sJfHbTM15QoP+dpfTJkCDrWA@mail.gmail.com>
On 21.04.2016 15:00, Geert Uytterhoeven wrote:
> On Thu, Apr 21, 2016 at 12:24 PM, Dirk Behme <dirk.behme@de.bosch.com> wrote:
>> In case thermal_zone_xxx_register() returns an error, priv->zone
>> isn't NULL any more, but contains the error code.
>>
>> This is passed to thermal_zone_device_unregister(), then. This checks
>> for priv->zone being NULL, but the error code is != NULL. So it works
>> with the error code as a pointer. Crashing immediately.
>>
>> To fix this, reset priv->zone to NULL before entering
>> rcar_gen3_thermal_remove().
>
> Alternatively, you could prevent a non-valid zone pointer from ever
> ending up in priv->zone by assigning the zone to a temporary variable,
> and only storing that in priv->zone after the error check.
>
>> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
>
> Regardless of the above
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Could this be applied, then?
Best regards
Dirk
prev parent reply other threads:[~2016-05-03 17:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-21 10:24 [PATCH] thermal: rcar_thermal: Fix priv->zone error handling Dirk Behme
2016-04-21 13:00 ` Geert Uytterhoeven
2016-05-03 17:46 ` Dirk Behme [this message]
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=5728E3EE.6030506@gmail.com \
--to=dirk.behme@gmail.com \
--cc=dirk.behme@de.bosch.com \
--cc=edubezval@gmail.com \
--cc=geert@linux-m68k.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-pm@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=rui.zhang@intel.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;
as well as URLs for NNTP newsgroup(s).