From: Jonathan Cameron <jic23@kernel.org>
To: Brian Masney <masneyb@onstation.org>
Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org,
gregkh@linuxfoundation.org
Subject: Re: [PATCH v3 3/5] staging: iio: isl29018: fixed race condition in in_illuminance_scale_available_show()
Date: Sat, 1 Oct 2016 14:53:23 +0100 [thread overview]
Message-ID: <5a81b7a7-e031-0f1e-9676-b81a00f00191@kernel.org> (raw)
In-Reply-To: <1474935620-13151-3-git-send-email-masneyb@onstation.org>
On 27/09/16 01:20, Brian Masney wrote:
> in_illuminance_scale_available_show() references the
> isl29018_chip->int_time variable in three places inside a for loop.
> The value of the int_time variable can be updated by the
> isl29018_set_integration_time() function, which is called by the
> isl29018_write_raw() function. isl29018_write_raw() locks a
> mutex specific to this driver when the integration time variable is
> updated.
>
> Signed-off-by: Brian Masney <masneyb@onstation.org>
This one I can get more enthusiastic about. Nice catch.
I thought about sending this for stable, but as the effect
is minor probably not worth it.
Applied to the togreg branch of iio.git and pushed out as
testing for the autobuilders to play with it.
Thanks,
Jonathan
> ---
> drivers/staging/iio/light/isl29018.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
> index 19f282c..990c6e5 100644
> --- a/drivers/staging/iio/light/isl29018.c
> +++ b/drivers/staging/iio/light/isl29018.c
> @@ -277,10 +277,12 @@ static ssize_t in_illuminance_scale_available_show
> unsigned int i;
> int len = 0;
>
> + mutex_lock(&chip->lock);
> for (i = 0; i < ARRAY_SIZE(isl29018_scales[chip->int_time]); ++i)
> len += sprintf(buf + len, "%d.%06d ",
> isl29018_scales[chip->int_time][i].scale,
> isl29018_scales[chip->int_time][i].uscale);
> + mutex_unlock(&chip->lock);
>
> buf[len - 1] = '\n';
>
>
next prev parent reply other threads:[~2016-10-01 13:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-25 17:29 [PATCH 1/2] include: linux: iio: add IIO_DEVICE_ATTR_{RO,WO,RW} macros Brian Masney
2016-09-25 17:29 ` [PATCH 2/2] staging: iio: isl29018: use IIO_DEVICE_ATTR_{RO,RW} macros Brian Masney
2016-09-25 17:58 ` [PATCH 1/2] include: linux: iio: add IIO_DEVICE_ATTR_{RO, WO, RW} macros Greg KH
2016-09-25 19:27 ` [PATCH v2 1/2] include: linux: iio: add IIO_ATTR_{RO,WO,RW} and IIO_DEVICE_ATTR_{RO,WO,RW} macros Brian Masney
2016-09-26 7:59 ` [PATCH v2 1/2] include: linux: iio: add IIO_ATTR_{RO, WO, RW} and IIO_DEVICE_ATTR_{RO, WO, RW} macros Greg KH
2016-09-27 0:20 ` [PATCH v3 1/5] " Brian Masney
2016-09-27 0:20 ` [PATCH v3 2/5] staging: iio: isl29018: use IIO_DEVICE_ATTR_{RO, " Brian Masney
2016-10-01 13:48 ` Jonathan Cameron
2016-09-27 0:20 ` [PATCH v3 3/5] staging: iio: isl29018: fixed race condition in in_illuminance_scale_available_show() Brian Masney
2016-10-01 13:53 ` Jonathan Cameron [this message]
2016-09-27 0:20 ` [PATCH v3 5/5] staging: iio: isl29018: check if the chip is in a suspended state Brian Masney
2016-10-01 13:59 ` Jonathan Cameron
2016-10-01 15:30 ` Brian Masney
2016-10-01 15:56 ` Jonathan Cameron
2016-10-01 13:47 ` [PATCH v3 1/5] include: linux: iio: add IIO_ATTR_{RO, WO, RW} and IIO_DEVICE_ATTR_{RO, WO, RW} macros Jonathan Cameron
[not found] ` <1474935620-13151-4-git-send-email-masneyb@onstation.org>
2016-10-01 13:55 ` [PATCH v3 4/5] staging: iio: isl29018: change isl29018_read_raw() to only have one exit point Jonathan Cameron
2016-09-25 19:27 ` [PATCH v2 2/2] staging: iio: isl29018: use IIO_DEVICE_ATTR_{RO,RW} macros Brian Masney
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=5a81b7a7-e031-0f1e-9676-b81a00f00191@kernel.org \
--to=jic23@kernel.org \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-iio@vger.kernel.org \
--cc=masneyb@onstation.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).