All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lee Jones <lee.jones@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 01/11] iio: sensors-core: st: Check st_sensors_set_drdy_int_pin()'s return value
Date: Sat, 30 Aug 2014 10:49:42 +0100	[thread overview]
Message-ID: <54019E36.4030304@kernel.org> (raw)
In-Reply-To: <1409231657-18294-1-git-send-email-lee.jones@linaro.org>

On 28/08/14 14:14, Lee Jones wrote:
> Value from st_sensors_set_drdy_int_pin() is assigned to err here,
> but that stored value is not used before it is overwritten.  To fix
> this we're enforcing a check on st_sensors_set_drdy_int_pin()'s
> return value and if it's an error, we're returning right away.
> 
> Cc: jic23@kernel.org
> Cc: linux-iio@vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Applied to the togreg branch of iio.git

Thanks,

Jonathan
> ---
>  drivers/iio/common/st_sensors/st_sensors_core.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
> index 8a4ec00..24cfe4e 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_core.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_core.c
> @@ -306,8 +306,11 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev,
>  	if (of_pdata)
>  		pdata = of_pdata;
>  
> -	if (pdata)
> +	if (pdata) {
>  		err = st_sensors_set_drdy_int_pin(indio_dev, pdata);
> +		if (err < 0)
> +			return err;
> +	}
>  
>  	err = st_sensors_set_enable(indio_dev, false);
>  	if (err < 0)
> 

WARNING: multiple messages have this Message-ID (diff)
From: jic23@kernel.org (Jonathan Cameron)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/11] iio: sensors-core: st: Check st_sensors_set_drdy_int_pin()'s return value
Date: Sat, 30 Aug 2014 10:49:42 +0100	[thread overview]
Message-ID: <54019E36.4030304@kernel.org> (raw)
In-Reply-To: <1409231657-18294-1-git-send-email-lee.jones@linaro.org>

On 28/08/14 14:14, Lee Jones wrote:
> Value from st_sensors_set_drdy_int_pin() is assigned to err here,
> but that stored value is not used before it is overwritten.  To fix
> this we're enforcing a check on st_sensors_set_drdy_int_pin()'s
> return value and if it's an error, we're returning right away.
> 
> Cc: jic23 at kernel.org
> Cc: linux-iio at vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Applied to the togreg branch of iio.git

Thanks,

Jonathan
> ---
>  drivers/iio/common/st_sensors/st_sensors_core.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
> index 8a4ec00..24cfe4e 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_core.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_core.c
> @@ -306,8 +306,11 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev,
>  	if (of_pdata)
>  		pdata = of_pdata;
>  
> -	if (pdata)
> +	if (pdata) {
>  		err = st_sensors_set_drdy_int_pin(indio_dev, pdata);
> +		if (err < 0)
> +			return err;
> +	}
>  
>  	err = st_sensors_set_enable(indio_dev, false);
>  	if (err < 0)
> 

  parent reply	other threads:[~2014-08-30  9:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 13:14 [PATCH 01/11] iio: sensors-core: st: Check st_sensors_set_drdy_int_pin()'s return value Lee Jones
2014-08-28 13:14 ` Lee Jones
2014-08-28 13:14 ` [PATCH 02/11] misc: st_core: Protect unsigned value against becoming negative Lee Jones
2014-08-28 13:14   ` Lee Jones
2014-08-28 13:14 ` [PATCH 03/11] misc: st_kim: Increase size of dev_name buffer to incorporate termination Lee Jones
2014-08-28 13:14   ` Lee Jones
2014-08-28 13:14 ` [PATCH 04/11] mfd: htc-i2cpld: container_of() cannot return NULL Lee Jones
2014-08-28 13:14   ` Lee Jones
2014-08-28 13:14 ` [PATCH 05/11] mfd: htc-i2cpld: Use '!variable' instead of 'variable == NULL' Lee Jones
2014-08-28 13:14   ` Lee Jones
2014-08-28 13:14 ` [PATCH 06/11] mfd: htc-i2cpld: Rectify pointer offset error Lee Jones
2014-08-28 13:14   ` Lee Jones
2014-08-28 13:14 ` [PATCH 07/11] mfd: wm5102: Insert missing break in case statement Lee Jones
2014-08-28 13:14   ` Lee Jones
2014-08-28 13:14 ` [PATCH 08/11] mfd: max77686: Remove check which is always true Lee Jones
2014-08-28 13:14   ` Lee Jones
2014-08-28 13:14 ` [PATCH 09/11] mfd: pcf50633: Check return value of platform_device_add() Lee Jones
2014-08-28 13:14   ` Lee Jones
2014-08-28 13:14 ` [PATCH 10/11] mfd: twl4030-irq: Check return value from twl_i2c_write() - warn() on failure Lee Jones
2014-08-28 13:14   ` Lee Jones
2014-08-28 13:14 ` [PATCH 11/11] mfd: sm501: Avoid implicit sign extension Lee Jones
2014-08-28 13:14   ` Lee Jones
2014-08-30  9:49 ` Jonathan Cameron [this message]
2014-08-30  9:49   ` [PATCH 01/11] iio: sensors-core: st: Check st_sensors_set_drdy_int_pin()'s return value 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=54019E36.4030304@kernel.org \
    --to=jic23@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@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.