hwmon: (max6697) fix regmap leak on probe failure
Subsystems (2)
PATCH 1/1 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 3a2a8cc3fe24 ("hwmon: (max6697) Convert to use regmap")
Cc [email protected] # 6.12
Cc Guenter Roeck <[email protected]>
Signed-off-by Johan Hovold <[email protected]>
--- drivers/hwmon/max6697.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/max6697.c +1 -1
@@ -548,7 +548,7 @@ static int max6697_probe(struct i2c_client *client)struct regmap *regmap;int err; - regmap =regmap_init_i2c (client, &max6697_regmap_config); + regmap =devm_regmap_init_i2c (client, &max6697_regmap_config);if (IS_ERR (regmap))return PTR_ERR (regmap);
Signature · 1 line
2.51.2
Quoted 9 lines · Johan Hovold
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 3a2a8cc3fe24 ("hwmon: (max6697) Convert to use regmap")Cc [email protected] # 6.12Cc Guenter Roeck <[email protected]>Signed-off-by Johan Hovold <[email protected]>
Applied.
Thanks,
Guenter