]> git.baikalelectronics.ru Git - kernel.git/commit
nvmem: core: return error for non word aligned access
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Mon, 14 Dec 2015 09:42:38 +0000 (09:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2016 07:09:13 +0000 (23:09 -0800)
commite919ad5d8f34baeae540340f939fa38c20df720d
tree3d63d41c671776a86dd02b4d7eca0011f158a091
parent4f7fed9a099705d59b2959dce840472ee1b08411
nvmem: core: return error for non word aligned access

nvmem providers have restrictions on register strides, so return error
when users attempt to read/write buffers with sizes which are less
than word size.

Without this patch the userspace would continue to try as it does not
get any error from the nvmem core, resulting in a hang or endless loop
in userspace.

Reported-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/core.c