Skip to content

Commit ffd46e7

Browse files
jhovoldgregkh
authored andcommitted
hwmon: (max6697) fix regmap leak on probe failure
commit 02f0ad8 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ef901d2 commit ffd46e7

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
@@ -548,7 +548,7 @@ static int max6697_probe(struct i2c_client *client)
548548
struct regmap *regmap;
549549
int err;
550550

551-
regmap = regmap_init_i2c(client, &max6697_regmap_config);
551+
regmap = devm_regmap_init_i2c(client, &max6697_regmap_config);
552552
if (IS_ERR(regmap))
553553
return PTR_ERR(regmap);
554554

0 commit comments

Comments
 (0)