]> git.hungrycats.org Git - linux/commitdiff
drivers/input/evdev.c: don't kfree() a vmalloc address
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 2 Dec 2014 23:59:31 +0000 (15:59 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Dec 2014 17:37:05 +0000 (09:37 -0800)
commit 92788ac1eb06e69a822de45e2a8a63fa45eb5be2 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: Christian Casteyde <casteyde.christian@free.fr>
Belatedly-Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/evdev.c

index de055451d1af6e5beab07118eb38b6a90003c8a8..b535322a36dbc7dcffbf599a6f9afe781664dfe1 100644 (file)
@@ -421,7 +421,7 @@ static int evdev_open(struct inode *inode, struct file *file)
 
  err_free_client:
        evdev_detach_client(evdev, client);
-       kfree(client);
+       kvfree(client);
        return error;
 }