greybus: use memdup_user()
authorAlex Elder <elder@linaro.org>
Thu, 14 Jul 2016 19:24:19 +0000 (14:24 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 15 Jul 2016 00:14:27 +0000 (09:14 +0900)
commitfc0c38b3d1d6648bfef8ed2478cd2505f6a97475
tree81b740108487df3e91aa18b585e60260f949b262
parent99ade1766dbd11652905ec91219a643992cb3c18
greybus: use memdup_user()

Coccinelle reports that there are two opportunities to use memdup_user()
in "authentication.c".  This patch simplifies the code in cap_ioctl() by
taking advantage of that.  Make use of a local variable "size" to improve
readability.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/authentication.c