linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>, linux-iio@vger.kernel.org
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH] iio: light: bh1780: return after write
Date: Wed, 4 May 2016 10:54:38 +0100	[thread overview]
Message-ID: <163d1fd5-6842-55c4-c112-c16f68a786d0@kernel.org> (raw)
In-Reply-To: <5fed5120-ed2c-60ab-704b-8a832ff91c23@kernel.org>

On 01/05/16 20:42, Jonathan Cameron wrote:
> On 28/04/16 13:02, Linus Walleij wrote:
>> When writing a value using direct reg access from debugfs
>> we need to return and not fall through to reading the
>> value, lest we'll dereference a NULL pointer.
>>
>> Cc: Dan Carpenter <dan.carpenter@oracle.com>
>> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> This is another one I'll have to pick up when I can create a fixes branch for
> post the merge window.
> 
> Poke me if I forget it.
> 
Applied to the fixes-togreg-post-rc1 branch of iio.git and not
pushed out for a few days (depending on battery of laptop vs free
wifi at Gare du Nord later)

Jonathan
> Jonathan
>> ---
>>  drivers/iio/light/bh1780.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/iio/light/bh1780.c b/drivers/iio/light/bh1780.c
>> index 72b364e4aa72..f83595334ff1 100644
>> --- a/drivers/iio/light/bh1780.c
>> +++ b/drivers/iio/light/bh1780.c
>> @@ -84,7 +84,7 @@ static int bh1780_debugfs_reg_access(struct iio_dev *indio_dev,
>>  	int ret;
>>  
>>  	if (!readval)
>> -		bh1780_write(bh1780, (u8)reg, (u8)writeval);
>> +		return bh1780_write(bh1780, (u8)reg, (u8)writeval);
>>  
>>  	ret = bh1780_read(bh1780, (u8)reg);
>>  	if (ret < 0)
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


      reply	other threads:[~2016-05-04 14:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 12:02 [PATCH] iio: light: bh1780: return after write Linus Walleij
2016-05-01 19:42 ` Jonathan Cameron
2016-05-04  9:54   ` Jonathan Cameron [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=163d1fd5-6842-55c4-c112-c16f68a786d0@kernel.org \
    --to=jic23@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@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 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).