From e105838d78545b29be66872e90d809175a6209d5 Mon Sep 17 00:00:00 2001 From: Mohan Srinivasan Date: Wed, 9 Aug 2017 12:36:33 -0700 Subject: [PATCH] ANDROID: keychord: Fix for a memory leak in keychord. Fixes a steady memory leak in the keychord release code. A close of the keychord device will leak 1 keychord structure. Easily reproducible by a simple program that does an open()->write()->close() of the keychord device. Bug: 64483974 Change-Id: I1fa402c666cffb00b8cfd6379d9fe47a0989152c Signed-off-by: Mohan Srinivasan (cherry picked from commit 72a8dae2c25d0277e48672ee85b70236268add01) Signed-off-by: Francisco Franco --- drivers/input/misc/keychord.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/misc/keychord.c b/drivers/input/misc/keychord.c index cf126d25c9ae..4f2aac414687 100644 --- a/drivers/input/misc/keychord.c +++ b/drivers/input/misc/keychord.c @@ -412,6 +412,7 @@ static int keychord_release(struct inode *inode, struct file *file) if (kdev->registered) input_unregister_handler(&kdev->input_handler); + kfree(kdev->keychords); kfree(kdev); return 0;