Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7c4c25e4 authored by Axel Lin's avatar Axel Lin Committed by Liam Girdwood
Browse files

regulator: max1586 - fix a memory leak in max1586_pmic_remove()



In max1586_pmic_probe(), we allocate memory for max1586.
In max1586_pmic_remove(), current implementation only free rdev
which is a member of struct max1586_data.
Thus, there is a small memory leak when we unload the module.

This patch fixes the memory leak by passing max1586 to i2c clientdata,
and properly kfree(max1586) in max1586_pmic_remove().

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent c4604e49
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment