Commit 92788ac1eb06e69a822de45e2a8a63fa45eb5be2

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent 91b57191cf

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: Christian Casteyde <casteyde.christian@free.fr>
Belatedly-Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Henrik Rydberg <rydberg@euromail.se>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/input/evdev.c
... ... @@ -421,7 +421,7 @@
421 421  
422 422 err_free_client:
423 423 evdev_detach_client(evdev, client);
424   - kfree(client);
  424 + kvfree(client);
425 425 return error;
426 426 }
427 427