Re: [PATCH 7/7] iio: light: tsl2583: fix concurrency issue in taos_get_lux()

2016-10-22 Thread Jonathan Cameron
On 19/10/16 11:32, Brian Masney wrote: > taos_get_lux() calls mutex_trylock(). If the lock could not be acquired, > then chip->als_cur_info.lux is returned. The issue is that this value > is updated while the mutex is held and could cause a half written value > to be returned to the caller. This pa

[PATCH 7/7] iio: light: tsl2583: fix concurrency issue in taos_get_lux()

2016-10-19 Thread Brian Masney
taos_get_lux() calls mutex_trylock(). If the lock could not be acquired, then chip->als_cur_info.lux is returned. The issue is that this value is updated while the mutex is held and could cause a half written value to be returned to the caller. This patch changes the call to mutex_trylock() with mu