Skip to content

Commit

Permalink
iio: imu: st_lsm6dsx: Fix wakeup source leaks on device unbind
Browse files Browse the repository at this point in the history
Device can be unbound, so driver must also release memory for the wakeup
source.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20250406-b4-device-wakeup-leak-iio-v1-3-2d7d322a4a93@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Krzysztof Kozlowski authored and Jonathan Cameron committed Apr 12, 2025
1 parent ad3764b commit 4551383
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2719,8 +2719,11 @@ int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id,
}

if (device_property_read_bool(dev, "wakeup-source") ||
(pdata && pdata->wakeup_source))
device_init_wakeup(dev, true);
(pdata && pdata->wakeup_source)) {
err = devm_device_init_wakeup(dev);
if (err)
return dev_err_probe(dev, err, "Failed to init wakeup\n");
}

return 0;
}
Expand Down

0 comments on commit 4551383

Please sign in to comment.