Skip to content

Commit 02f0ad8

Browse files
jhovoldgroeck
authored andcommitted
hwmon: (max6697) fix regmap leak on probe failure
The i2c regmap allocated during probe is never freed. Switch to using the device managed allocator so that the regmap is released on probe failures (e.g. probe deferral) and on driver unbind. Fixes: 3a2a8cc ("hwmon: (max6697) Convert to use regmap") Cc: stable@vger.kernel.org # 6.12 Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20251127134351.1585-1-johan@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 72e5c0d commit 02f0ad8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/hwmon/max6697.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ static int max6697_probe(struct i2c_client *client)
542542
struct regmap *regmap;
543543
int err;
544544

545-
regmap = regmap_init_i2c(client, &max6697_regmap_config);
545+
regmap = devm_regmap_init_i2c(client, &max6697_regmap_config);
546546
if (IS_ERR(regmap))
547547
return PTR_ERR(regmap);
548548

0 commit comments

Comments
 (0)