Skip to contentSkip to conversation

Staging: panel: fix memory leak

PATCH New Kulikov Vasiliy 1 participant 1 message Jul 12, 2010

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

PATCH 1/1 Staging: panel: fix memory leak

panel_bind_key() must free allocated memory.

---
 drivers/staging/panel/panel.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/staging/panel/panel.c +3 -1
index 3154ffe..0fa910d 100644
@@ -1999,8 +1999,10 @@ static struct logical_input *panel_bind_key(char *name, char *press,
 		return NULL;
 	}
 	if (!input_name2mask(name, &key->mask, &key->value, &scan_mask_i,
-			     &scan_mask_o))
+			     &scan_mask_o)) {
+		kfree(key);
 		return NULL;
+	}
 
 	key->type = INPUT_TYPE_KBD;
 	key->state = INPUT_ST_LOW;
Signature · 1 line
1.7.0.4