Skip to content

Commit e57eabe

Browse files
Bartosz Golaszewskiij-intel
authored andcommitted
platform/x86: thinkpad_acpi: check the return value of devm_mutex_init()
devm_mutex_init() can fail so check its return value. Fixes: 38b9ab8 ("platform/x86: thinkpad_acpi: Move subdriver initialization to tpacpi_pdriver's probe.") Signed-off-by: Bartosz Golaszewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 7bb84ca commit e57eabe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11849,7 +11849,9 @@ static int __init tpacpi_pdriver_probe(struct platform_device *pdev)
1184911849
{
1185011850
int ret;
1185111851

11852-
devm_mutex_init(&pdev->dev, &tpacpi_inputdev_send_mutex);
11852+
ret = devm_mutex_init(&pdev->dev, &tpacpi_inputdev_send_mutex);
11853+
if (ret)
11854+
return ret;
1185311855

1185411856
tpacpi_inputdev = devm_input_allocate_device(&pdev->dev);
1185511857
if (!tpacpi_inputdev)

0 commit comments

Comments
 (0)