diff options
author | Mohan Srinivasan <srmohan@google.com> | 2017-08-09 12:36:33 -0700 |
---|---|---|
committer | Mohan Srinivasan <srmohan@google.com> | 2017-08-11 19:54:55 +0000 |
commit | 60366263e6aeac89f9c92978d075529ef3303c0a (patch) | |
tree | 8ce9467785f13b51b3958a5b07997f68b05c8b46 | |
parent | 462acca2816ee795fde81bdd99ca6e10bfe00d27 (diff) | |
download | v4.4-60366263e6aeac89f9c92978d075529ef3303c0a.tar.gz |
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 <srmohan@google.com>
(cherry picked from commit 72a8dae2c25d0277e48672ee85b70236268add01)
-rw-r--r-- | drivers/input/misc/keychord.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/input/misc/keychord.c b/drivers/input/misc/keychord.c index 1673e4239403..fdcc14653b64 100644 --- a/drivers/input/misc/keychord.c +++ b/drivers/input/misc/keychord.c @@ -432,6 +432,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; |