Skip to contentSkip to conversation

Input: omap-keypad: fix memory leak

PATCH Applied Sudip Mukherjee 2 participants 2 messages Sep 18, 2015 – Sep 28, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: omap-keypad: fix memory leak

If omap4_keypad_parse_dt() fails we returned the error code but we missed releasing keypad_data.

---
 drivers/input/keyboard/omap4-keypad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/omap4-keypad.c +1 -1
index b052afe..6639b2b 100644
@@ -266,7 +266,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 
 	error = omap4_keypad_parse_dt(&pdev->dev, keypad_data);
 	if (error)
-		return error;
+		goto err_free_keypad;
 
 	res = request_mem_region(res->start, resource_size(res), pdev->name);
 	if (!res) {
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Sudip Mukherjee

If omap4_keypad_parse_dt() fails we returned the error code but we missed releasing keypad_data.

Applied, thank you.

Quoted 20 lines
---
 drivers/input/keyboard/omap4-keypad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/omap4-keypad.c +1 -1
index b052afe..6639b2b 100644
@@ -266,7 +266,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 
 	error = omap4_keypad_parse_dt(&pdev->dev, keypad_data);
 	if (error)
-		return error;
+		goto err_free_keypad;
 
 	res = request_mem_region(res->start, resource_size(res), pdev->name);
 	if (!res) {
Signature · 1 line
1.9.1
Signature · 1 line
Dmitry