Skip to content

Commit

Permalink
ANDROID: keychord: Fix for a memory leak in keychord.
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit 72a8dae2c25d0277e48672ee85b70236268add01)
Signed-off-by: Francisco Franco <[email protected]>
  • Loading branch information
Mohan Srinivasan authored and franciscofranco committed May 11, 2018
1 parent 560c562 commit e105838
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/input/misc/keychord.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e105838

Please sign in to comment.