Re: [PATCH 3/3] iio: frequency: ad9834: add mutex_lock() when reading st->control
From: Dan Carpenter
Date: Tue Apr 14 2026 - 05:41:05 EST
On Tue, Apr 14, 2026 at 09:12:50AM +0000, Joshua Crofts wrote:
> Add mutex_lock() and mutex_unlock() when reading st->control to
> prevent data races as st->control is actively modified by
> sysfs _write and _store functions.
>
> Signed-off-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
> ---
This doesn't matter in real life. "Oops, the root user tried
really hard to do something stupid and got "square" as the output
a fraction of a milisecond longer than they were supposed to."
Is there a tool which detects and complains about this?
regards,
dan carpenter