summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2025-02-04 07:52:50 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-10 14:44:24 +0200
commit398168477aed1ffc92165b5c0a6a58a043341173 (patch)
tree3b9181127c1104e41893b709dec8e511600ae2b3 /drivers
parent421ef42b0e67f3a4f128aa867294f3d3be336c0a (diff)
downloadlinux-398168477aed1ffc92165b5c0a6a58a043341173.tar.gz
linux-398168477aed1ffc92165b5c0a6a58a043341173.tar.bz2
linux-398168477aed1ffc92165b5c0a6a58a043341173.zip
leds: st1202: Check for error code from devm_mutex_init() call
[ Upstream commit 8168906bbb3ba678583422de29e6349407a94bb5 ] 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: 259230378c65 ("leds: Add LED1202 I2C driver") Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20250204-must_check-devm_mutex_init-v2-1-7b6271c4b7e6@weissschuh.net Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/leds/leds-st1202.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/leds/leds-st1202.c b/drivers/leds/leds-st1202.c
index e894b3f9a0f4..4cebc0203c22 100644
--- a/drivers/leds/leds-st1202.c
+++ b/drivers/leds/leds-st1202.c
@@ -345,7 +345,9 @@ static int st1202_probe(struct i2c_client *client)
if (!chip)
return -ENOMEM;
- devm_mutex_init(&client->dev, &chip->lock);
+ ret = devm_mutex_init(&client->dev, &chip->lock);
+ if (ret < 0)
+ return ret;
chip->client = client;
ret = st1202_dt_init(chip);