https://github.com/torvalds/linux
Revision 38463721ec3c39acdabed3a89016ce6bb32a7543 authored by Adamski, Krzysztof (Nokia - PL/Wroclaw) on 29 May 2019, 14:33:52 UTC, committed by Guenter Roeck on 06 June 2019, 01:36:27 UTC
update_lock is a mutex intended to protect write operations. It was not
taken, however, when _pmbus_write_word_data is called from
pmbus_set_samples() function which may cause problems especially when
some PMBUS_VIRT_* operation is implemented as a read-modify-write cycle.

This patch makes sure the lock is held during the operation.

Fixes: 49c4455dccf2 ("hwmon: (pmbus) Introduce PMBUS_VIRT_*_SAMPLES registers")
Signed-off-by: Krzysztof Adamski <krzysztof.adamski@nokia.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
[groeck: Declared and initialized missing 'data' variable]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent c41dd48
History
Tip revision: 38463721ec3c39acdabed3a89016ce6bb32a7543 authored by Adamski, Krzysztof (Nokia - PL/Wroclaw) on 29 May 2019, 14:33:52 UTC
hwmon: (pmbus/core) mutex_lock write in pmbus_set_samples
Tip revision: 3846372

back to top