Skip to content

Commit dc28d26

Browse files
krzkmehmetb0
authored andcommitted
iio: imu: st_lsm6dsx: Fix wakeup source leaks on device unbind
BugLink: https://bugs.launchpad.net/bugs/2115678 [ Upstream commit 4551383e78d59b34eea3f4ed28ad22df99e25d59 ] 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> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
1 parent 1573a57 commit dc28d26

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)