From: Zhang Rui <rui.zhang@intel.com>
To: Devendra Naga <devendra.aaru@gmail.com>
Cc: linux-pm@vger.kernel.org
Subject: Re: [PATCH] thermal: fair_share: check for a valid thermal zone device
Date: Mon, 01 Apr 2013 09:05:01 +0800 [thread overview]
Message-ID: <1364778301.2178.7.camel@rzhang1-mobl4> (raw)
In-Reply-To: <1364637877-28068-1-git-send-email-devendra.aaru@gmail.com>
On Sat, 2013-03-30 at 15:34 +0530, Devendra Naga wrote:
> to be on safe side check for a valid thermal zone device and fail if there
> is no thermal zone device.
>
> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
> ---
> drivers/thermal/fair_share.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/fair_share.c b/drivers/thermal/fair_share.c
> index 792479f..4cd1d47 100644
> --- a/drivers/thermal/fair_share.c
> +++ b/drivers/thermal/fair_share.c
> @@ -85,7 +85,7 @@ static int fair_share_throttle(struct thermal_zone_device *tz, int trip)
> int i;
> int cur_trip_level = get_trip_level(tz);
>
> - if (!tz->tzp || !tz->tzp->tbp)
> + if (!tz || !tz->tzp || !tz->tzp->tbp)
> return -EINVAL;
when tz equals NULL, it suggests a really serious problem, and IMO, a
NULL pointer dereference or Panic in this case is more meaningful.
thanks,
rui
prev parent reply other threads:[~2013-04-01 1:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-30 10:04 [PATCH] thermal: fair_share: check for a valid thermal zone device Devendra Naga
2013-04-01 1:05 ` Zhang Rui [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=1364778301.2178.7.camel@rzhang1-mobl4 \
--to=rui.zhang@intel.com \
--cc=devendra.aaru@gmail.com \
--cc=linux-pm@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.