]> Git Repo - linux.git/commitdiff
gpio: sloppy-logic-analyzer: Check for error code from devm_mutex_init() call
authorAndy Shevchenko <[email protected]>
Wed, 30 Oct 2024 17:36:52 +0000 (19:36 +0200)
committerBartosz Golaszewski <[email protected]>
Thu, 31 Oct 2024 12:48:25 +0000 (13:48 +0100)
Even if it's not critical, the avoidance of checking the error code
from devm_mutex_init() call today diminishes the point of using devm
variant of it. Tomorrow it may even leak something. Add the missed
check.

Fixes: 7828b7bbbf20 ("gpio: add sloppy logic analyzer using polling")
Reviewed-by: Wolfram Sang <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
drivers/gpio/gpio-sloppy-logic-analyzer.c

index 07e0d7180579ccaec1adbd4c62139881c6438f9c..59a8f3a5c4e4849769891b8a78f2348dfdc89f5d 100644 (file)
@@ -234,7 +234,9 @@ static int gpio_la_poll_probe(struct platform_device *pdev)
        if (!priv)
                return -ENOMEM;
 
-       devm_mutex_init(dev, &priv->blob_lock);
+       ret = devm_mutex_init(dev, &priv->blob_lock);
+       if (ret)
+               return ret;
 
        fops_buf_size_set(priv, GPIO_LA_DEFAULT_BUF_SIZE);
 
This page took 0.053875 seconds and 4 git commands to generate.