OSDN Git Service

nvmem: core: return error for non word aligned access
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tue, 17 Nov 2015 09:12:41 +0000 (09:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2016 07:07:21 +0000 (23:07 -0800)
commit313a72ff983cc2e00ac4dcb791d40ebf2f9d5718
treee4031aac8cd831d5e737acc4f52ca56f73ddabdb
parent4c7e4fe3776693ee4554ca1b3a2c728c1f8f361a
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