linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Gregor Boirie <gregor.boirie@parrot.com>, linux-iio@vger.kernel.org
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Irina Tirdea <irina.tirdea@intel.com>,
	Cristina Moraru <cristina.moraru09@gmail.com>,
	Daniel Baluta <daniel.baluta@intel.com>,
	Julia Lawall <Julia.Lawall@lip6.fr>
Subject: Re: [PATCH v2 1/5] iio:magnetometer:ak8975: fix uninitialized chipset
Date: Sat, 5 Mar 2016 15:24:45 +0000	[thread overview]
Message-ID: <56DAFA3D.7090305@kernel.org> (raw)
In-Reply-To: <2a478132d071a144e6621832ac3badd2f636d61a.1457001111.git.gregor.boirie@parrot.com>

On 03/03/16 10:44, Gregor Boirie wrote:
> ak_def_array bounds are not properly checked in case of ACPI matching
> failure. GCC warns with the following message at line 799:
> ‘chipset’ may be used uninitialized in this function.
> 
> Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Applied.
> ---
>  drivers/iio/magnetometer/ak8975.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
> index 9c5c9ef..11059b2 100644
> --- a/drivers/iio/magnetometer/ak8975.c
> +++ b/drivers/iio/magnetometer/ak8975.c
> @@ -774,8 +774,11 @@ static int ak8975_probe(struct i2c_client *client,
>  	if (id) {
>  		chipset = (enum asahi_compass_chipset)(id->driver_data);
>  		name = id->name;
> -	} else if (ACPI_HANDLE(&client->dev))
> +	} else if (ACPI_HANDLE(&client->dev)) {
>  		name = ak8975_match_acpi_device(&client->dev, &chipset);
> +		if (!name)
> +			return -ENODEV;
> +	}
>  	else
>  		return -ENOSYS;
>  
> 


  reply	other threads:[~2016-03-05 15:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 10:44 [PATCH v2 0/5] iio:magnetometer:ak8975: fix and enhancements Gregor Boirie
2016-03-03 10:44 ` [PATCH v2 1/5] iio:magnetometer:ak8975: fix uninitialized chipset Gregor Boirie
2016-03-05 15:24   ` Jonathan Cameron [this message]
2016-03-03 10:44 ` [PATCH v2 2/5] iio:magnetometer:ak8975: remove unused field Gregor Boirie
2016-03-05 15:25   ` Jonathan Cameron
2016-03-03 10:44 ` [PATCH v2 3/5] iio:magnetometer:ak8975: power regulator support Gregor Boirie
2016-03-05 15:26   ` Jonathan Cameron
2016-03-03 10:44 ` [PATCH v2 4/5] iio:magnetometer:ak8975: mounting matrix support Gregor Boirie
2016-03-05 15:36   ` Jonathan Cameron
2016-03-09 10:56     ` Gregor Boirie
2016-03-09 20:46       ` Jonathan Cameron
2016-03-10  2:15         ` Rob Herring
2016-03-12  9:44           ` Jonathan Cameron
2016-03-14 17:19         ` Gregor Boirie
2016-03-15 21:56           ` Jonathan Cameron
2016-03-17 16:15             ` Gregor Boirie
2016-03-03 10:44 ` [PATCH v2 5/5] iio:magnetometer:ak8975: triggered buffer support Gregor Boirie
2016-03-05 15:45   ` Jonathan Cameron

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=56DAFA3D.7090305@kernel.org \
    --to=jic23@kernel.org \
    --cc=Julia.Lawall@lip6.fr \
    --cc=cristina.moraru09@gmail.com \
    --cc=daniel.baluta@intel.com \
    --cc=geert@linux-m68k.org \
    --cc=gregor.boirie@parrot.com \
    --cc=irina.tirdea@intel.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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).