Skip to content

Commit 8168906

Browse files
t-8chlag-linaro
authored andcommitted
leds: st1202: 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: 2592303 ("leds: Add LED1202 I2C driver") Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/r/20250204-must_check-devm_mutex_init-v2-1-7b6271c4b7e6@weissschuh.net Signed-off-by: Lee Jones <[email protected]>
1 parent 59670b2 commit 8168906

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/leds/leds-st1202.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ static int st1202_probe(struct i2c_client *client)
356356
if (!chip)
357357
return -ENOMEM;
358358

359-
devm_mutex_init(&client->dev, &chip->lock);
359+
ret = devm_mutex_init(&client->dev, &chip->lock);
360+
if (ret < 0)
361+
return ret;
360362
chip->client = client;
361363

362364
ret = st1202_dt_init(chip);

0 commit comments

Comments
 (0)