]> git.baikalelectronics.ru Git - kernel.git/commit
Input: joydev - use memdup_user() to duplicate memory from user-space
authorJavier Martinez Canillas <javier@osg.samsung.com>
Fri, 2 Oct 2015 18:12:53 +0000 (11:12 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 2 Oct 2015 18:44:16 +0000 (11:44 -0700)
commit7759c876f221fcb83d20bd6a08aa7feecb20d770
tree4e81af9337a13eb55af535cbb028ac6a9b52bf8e
parent8eea10b53d27d4636605bcce3757ed94bd93e1f2
Input: joydev - use memdup_user() to duplicate memory from user-space

The memdup_user() helper function can be used to duplicate a memory region
from user-space to kernel-space. There is no need to open code the same
logic using kmalloc() and copy_from_user() instead. This was found with
make coccicheck that reported the following warning:

drivers/input/joydev.c:447:10-17: WARNING opportunity for memdup_user
drivers/input/joydev.c:483:10-17: WARNING opportunity for memdup_user

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/joydev.c