diff options
| author | Jiale Yao <yaojiale02@163.com> | 2026-09-25 22:09:43 +0800 |
|---|---|---|
| committer | Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> | 2026-09-30 18:59:56 +0100 |
| commit | dd30c10ff60d2b30386c23bb7c61cc97f2385c97 (patch) | |
| tree | a350f3936020fc2f4fb79ea5d04092ea36c850f3 /drivers | |
| parent | 84bb0fc46ccf6a545b8fdf57cda83770186ed8dd (diff) | |
| download | linux-stable-dd30c10ff60d2b30386c23bb7c61cc97f2385c97.tar.gz linux-stable-dd30c10ff60d2b30386c23bb7c61cc97f2385c97.zip | |
iio: accel: kxcjk-1013: reject duplicate event disable
The IIO core does not filter duplicate writes to the event enable
attribute. kxcjk1013_write_event_config() already ignores repeated
enable requests, but a repeated disable request still calls
kxcjk1013_set_power_state(data, false), dropping a runtime PM reference
that was not acquired for this request. This can underflow the runtime
PM usage count and trigger a "Runtime PM usage count underflow" warning.
Return early when the requested state already matches ev_enable_state.
Fixes: b4b491c0832e ("iio: accel: kxcjk-1013: Support thresholds")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/iio/accel/kxcjk-1013.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 166fb7864..8994c9e8e 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -1030,7 +1030,7 @@ static int kxcjk1013_write_event_config(struct iio_dev *indio_dev, struct kxcjk1013_data *data = iio_priv(indio_dev); int ret; - if (state && data->ev_enable_state) + if (state == data->ev_enable_state) return 0; mutex_lock(&data->mutex); |
