linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: Wei Ni <wni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [bug report] thermal: tegra: add hw-throttle function
Date: Thu, 13 Oct 2016 12:35:31 +0300	[thread overview]
Message-ID: <20161013093531.GA29895@mwanda> (raw)

Hello Wei Ni,

This is a semi-automatic email about new static checker warnings.

The patch ce0dbf04f685: "thermal: tegra: add hw-throttle function" 
from May 11, 2016, leads to the following Smatch complaint:

drivers/thermal/tegra/soctherm.c:486 throttrip_program()
	 warn: variable dereferenced before check 'dev' (see line 481)

drivers/thermal/tegra/soctherm.c
   480	{
   481		struct tegra_soctherm *ts = dev_get_drvdata(dev);
                                                            ^^^
Dereference inside function.

   482		int temp, cpu_throt, gpu_throt;
   483		unsigned int throt;
   484		u32 r, reg_off;
   485	
   486		if (!dev || !sg || !stc || !stc->init)
                     ^^^
Check is too late.

   487			return -EINVAL;
   488	

regards,
dan carpenter

                 reply	other threads:[~2016-10-13  9:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20161013093531.GA29895@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=wni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.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 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).