Commit 93ecb50a authored by Andrew Morton's avatar Andrew Morton Committed by Luis Henriques

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

commit 92788ac1 upstream.

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>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent a10a000e
...@@ -422,7 +422,7 @@ static int evdev_open(struct inode *inode, struct file *file) ...@@ -422,7 +422,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