From fc375bad6a4b62a755d57d63bcea5b9b78c62385 Mon Sep 17 00:00:00 2001 From: Vevek Venkatesan Date: Mon, 10 Jul 2017 15:09:39 +0530 Subject: [PATCH] input: misc: hbtp_input: fix memory corruption in list_del_entry Fix memory corruption in the hbtp_input driver by adding complete in the release routine to resolve the Kernel crash in __list_del_entry corruption. Signed-off-by: Vevek Venkatesan Change-Id: I764923317f720137bfd4e7adfc6bf763a36911c3 --- drivers/input/misc/hbtp_input.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/input/misc/hbtp_input.c b/drivers/input/misc/hbtp_input.c index 56f2732334db..30da797a85dc 100644 --- a/drivers/input/misc/hbtp_input.c +++ b/drivers/input/misc/hbtp_input.c @@ -249,6 +249,10 @@ static int hbtp_input_release(struct inode *inode, struct file *file) return -ENOTTY; } hbtp->count--; + if (!completion_done(&hbtp->power_suspend_sig)) + complete(&hbtp->power_suspend_sig); + if (!completion_done(&hbtp->power_resume_sig)) + complete(&hbtp->power_resume_sig); if (hbtp->power_sig_enabled) hbtp->power_sig_enabled = false; mutex_unlock(&hbtp->mutex);