Skip to content

Commit 1ca5e63

Browse files
krzkSasha Levin
authored andcommitted
iio: imu: st_lsm6dsx: Fix wakeup source leaks on device unbind
[ Upstream commit 4551383 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c01b81a commit 1ca5e63

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,8 +2719,11 @@ int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id,
27192719
}
27202720

27212721
if (device_property_read_bool(dev, "wakeup-source") ||
2722-
(pdata && pdata->wakeup_source))
2723-
device_init_wakeup(dev, true);
2722+
(pdata && pdata->wakeup_source)) {
2723+
err = devm_device_init_wakeup(dev);
2724+
if (err)
2725+
return dev_err_probe(dev, err, "Failed to init wakeup\n");
2726+
}
27242727

27252728
return 0;
27262729
}

0 commit comments

Comments
 (0)