diff options
| author | Andy Shevchenko <[email protected]> | 2024-10-30 17:36:52 +0000 |
|---|---|---|
| committer | Bartosz Golaszewski <[email protected]> | 2024-10-31 12:48:25 +0000 |
| commit | 90bad749858cf88d80af7c2b23f86db4f7ad61c2 (patch) | |
| tree | 36a988271c6bfe9c174408dc1672e4998cd4c7f8 | |
| parent | gpio: fix uninit-value in swnode_find_gpio (diff) | |
| download | kernel-90bad749858cf88d80af7c2b23f86db4f7ad61c2.tar.gz kernel-90bad749858cf88d80af7c2b23f86db4f7ad61c2.zip | |
gpio: sloppy-logic-analyzer: Check for error code from devm_mutex_init() call
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]>
| -rw-r--r-- | drivers/gpio/gpio-sloppy-logic-analyzer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-sloppy-logic-analyzer.c b/drivers/gpio/gpio-sloppy-logic-analyzer.c index 07e0d7180579..59a8f3a5c4e4 100644 --- a/drivers/gpio/gpio-sloppy-logic-analyzer.c +++ b/drivers/gpio/gpio-sloppy-logic-analyzer.c @@ -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); |
