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 <vevekv@codeaurora.org>
Change-Id: I764923317f720137bfd4e7adfc6bf763a36911c3
This commit is contained in:
Vevek Venkatesan 2017-07-10 15:09:39 +05:30
parent 9f462e8a2b
commit fc375bad6a

View file

@ -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);