Commit 92788ac1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

drivers/input/evdev.c: don't kfree() a vmalloc address

If kzalloc() failed and then evdev_open_device() fails, evdev_open()
will pass a vmalloc'ed pointer to kfree.

This might fix https://bugzilla.kernel.org/show_bug.cgi?id=88401, where
there was a crash in kfree().
Reported-by: default avatarChristian Casteyde <casteyde.christian@free.fr>
Belatedly-Acked-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Henrik Rydberg <rydberg@euromail.se>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 91b57191
...@@ -421,7 +421,7 @@ static int evdev_open(struct inode *inode, struct file *file) ...@@ -421,7 +421,7 @@ static int evdev_open(struct inode *inode, struct file *file)
err_free_client: err_free_client:
evdev_detach_client(evdev, client); evdev_detach_client(evdev, client);
kfree(client); kvfree(client);
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment