[PATCH 7/7] power: reset: reboot-mode: fix memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



magicbuf is only used for comparisons and debug output in
reboot_mode_register() and is then leaked after its return.

Free it instead once no longer needed.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 drivers/power/reset/nvmem-reboot-mode.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/power/reset/nvmem-reboot-mode.c b/drivers/power/reset/nvmem-reboot-mode.c
index 1a9422800ef7..446951dd77c7 100644
--- a/drivers/power/reset/nvmem-reboot-mode.c
+++ b/drivers/power/reset/nvmem-reboot-mode.c
@@ -71,6 +71,8 @@ static int nvmem_reboot_mode_probe(struct device *dev)
 	if (ret)
 		dev_err(dev, "can't register reboot mode\n");
 
+	free(magicbuf);
+
 	return ret;
 }
 
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux