Message ID | 20250305103146.53221-1-brgl@bgdev.pl (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
Series | platform/x86: thinkpad_acpi: check the return value of devm_mutex_init() | expand |
On Wed, 05 Mar 2025 11:31:46 +0100, Bartosz Golaszewski wrote: > 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.
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 6128ad820ea0..d8df1405edfa 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -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)