Skip to content

Commit 20f35d3

Browse files
krzkgregkh
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 <[email protected]> Acked-by: Lorenzo Bianconi <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 09e0ba8 commit 20f35d3

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)