From: Mohan Srinivasan Date: Wed, 9 Aug 2017 19:36:33 +0000 (-0700) Subject: ANDROID: input: keychord: Fix for a memory leak in keychord. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=29be5c0c2ef587e7958ef16cc8357e8880e92cd9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ANDROID: input: 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 --- diff --git a/drivers/input/misc/keychord.c b/drivers/input/misc/keychord.c index afff15f5c2e0..b09ecf743635 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;