Staging: rtl8712: Use memdup_user() instead of copy_from_user()
authorCristina Opriceana <cristina.opriceana@gmail.com>
Sat, 28 Mar 2015 00:57:34 +0000 (02:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2015 15:26:58 +0000 (17:26 +0200)
commit45de432775d6df1b349b02c4d783237937278906
tree3b5005cb3d215ef7805b0de5864e911ca5f13625
parent66687e6aed4ab25ab5aac52ed94b277c4db2093f
Staging: rtl8712: Use memdup_user() instead of copy_from_user()

Use memdup_user() to avoid its duplicated implementation and simplify
code. memdup_user() uses GFP_KERNEL instead of GFP_ATOMIC,
which is valid because copy_from_user() might sleep and it's useless
to make the allocation atomic. Found with coccinelle.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl871x_ioctl_linux.c