Skip to content

Commit

Permalink
iio: adc: qcom-spmi-iadc: 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>
Link: https://patch.msgid.link/20250406-b4-device-wakeup-leak-iio-v1-2-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 0cd34d9 commit ad3764b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/iio/adc/qcom-spmi-iadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,9 @@ static int iadc_probe(struct platform_device *pdev)
else
return ret;
} else {
device_init_wakeup(iadc->dev, 1);
ret = devm_device_init_wakeup(iadc->dev);
if (ret)
return dev_err_probe(iadc->dev, ret, "Failed to init wakeup\n");
}

ret = iadc_update_offset(iadc);
Expand Down

0 comments on commit ad3764b

Please sign in to comment.