platform/x86: thinkpad_acpi: check the return value of devm_mutex_init()
PATCH 1/1 platform/x86: thinkpad_acpi: check the return value of devm_mutex_init()
From: Bartosz Golaszewski <[email protected]>
devm_mutex_init() can fail so check its return value.
Fixes 38b9ab80db31 ("platform/x86: thinkpad_acpi: Move subdriver initialization to tpacpi_pdriver's probe.")
Signed-off-by Bartosz Golaszewski <[email protected]>
--- drivers/platform/x86/thinkpad_acpi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/thinkpad_acpi.c +3 -1
@@ -11849,7 +11849,9 @@ static int __init tpacpi_pdriver_probe(struct platform_device *pdev) {int ret; -devm_mutex_init (&pdev->dev, &tpacpi_inputdev_send_mutex); + ret =devm_mutex_init (&pdev->dev, &tpacpi_inputdev_send_mutex); +if (ret) +return ret; tpacpi_inputdev =devm_input_allocate_device (&pdev->dev);if (!tpacpi_inputdev)
Signature · 1 line
2.45.2
Ilpo Järvinen
maintainerQuoted 3 lines · Bartosz Golaszewski
devm_mutex_init()can fail so check its return value.
Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.
The list of commits applied:
[1/1] platform/x86: thinkpad_acpi: check the return value of devm_mutex_init()
commit: e57eabe2fb044950e6ffdfe01803895043dec0b7
--
i.