[PATCH] pinctrl: keembay: fix memleak in keembay_build_functions()

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

 



From: Rafał Miłecki <rafal@xxxxxxxxxx>

Add missing kfree().

Signed-off-by: Rafał Miłecki <rafal@xxxxxxxxxx>
---
This is NOT run-time tested, Lakshmi would you like to test it first?
---
 drivers/pinctrl/pinctrl-keembay.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-keembay.c
index 152c35bce8ec..51b684201b20 100644
--- a/drivers/pinctrl/pinctrl-keembay.c
+++ b/drivers/pinctrl/pinctrl-keembay.c
@@ -1599,6 +1599,7 @@ static int keembay_add_functions(struct keembay_pinctrl *kpc,
 static int keembay_build_functions(struct keembay_pinctrl *kpc)
 {
 	struct function_desc *keembay_funcs, *new_funcs;
+	int err;
 	int i;
 
 	/*
@@ -1643,7 +1644,11 @@ static int keembay_build_functions(struct keembay_pinctrl *kpc)
 		return -ENOMEM;
 	}
 
-	return keembay_add_functions(kpc, new_funcs);
+	err = keembay_add_functions(kpc, new_funcs);
+
+	kfree(new_funcs);
+
+	return err;
 }
 
 static const struct keembay_pin_soc keembay_data = {
-- 
2.34.1




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux