summaryrefslogtreecommitdiffstats
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2021-11-30 14:39:09 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-03 16:03:37 +0100
commit86192251033308bb42f1e9813c962989d8ed07ec (patch)
treee78844498cd512882c5d2bf8dee886cddee78643 /drivers/nvmem
parentw1: Misuse of get_user()/put_user() reported by sparse (diff)
downloadlinux-86192251033308bb42f1e9813c962989d8ed07ec.tar.xz
linux-86192251033308bb42f1e9813c962989d8ed07ec.zip
nvmem: core: set size for sysfs bin file
For some reason we never set the size for nvmem sysfs binary file. Set this. Reported-by: Gilles BULOZ <gilles.buloz@kontron.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20211130133909.6154-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index e765d3d0542e..23a38dcf0fc4 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -312,6 +312,8 @@ static umode_t nvmem_bin_attr_is_visible(struct kobject *kobj,
struct device *dev = kobj_to_dev(kobj);
struct nvmem_device *nvmem = to_nvmem_device(dev);
+ attr->size = nvmem->size;
+
return nvmem_bin_attr_get_umode(nvmem);
}