Skip to content

Commit 90bad74

Browse files
andy-shevBartosz Golaszewski
authored andcommitted
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: 7828b7b ("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]>
1 parent a14968a commit 90bad74

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpio/gpio-sloppy-logic-analyzer.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ static int gpio_la_poll_probe(struct platform_device *pdev)
234234
if (!priv)
235235
return -ENOMEM;
236236

237-
devm_mutex_init(dev, &priv->blob_lock);
237+
ret = devm_mutex_init(dev, &priv->blob_lock);
238+
if (ret)
239+
return ret;
238240

239241
fops_buf_size_set(priv, GPIO_LA_DEFAULT_BUF_SIZE);
240242

0 commit comments

Comments
 (0)