Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92154c28 authored by Jianqiang Zhao's avatar Jianqiang Zhao Committed by Dyneteve
Browse files

ANDROID: input: keychord: fix race condition bug



Change-Id: I9c7c759c99e21cad9a7f9a09128122bf6ae11302
Signed-off-by: default avatarJianqiang Zhao <zhaojianqiang1@gmail.com>
Bug: 36006779
parent cb1a537c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -300,8 +300,10 @@ static ssize_t keychord_write(struct file *file, const char __user *buffer,

	ret = input_register_handler(&kdev->input_handler);
	if (ret) {
		kfree(keychords);
		spin_lock_irqsave(&kdev->lock, flags);
		kfree(kdev->keychords);
		kdev->keychords = 0;
		spin_unlock_irqrestore(&kdev->lock, flags);
		return ret;
	}
	kdev->registered = 1;