summaryrefslogtreecommitdiff
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorDenys Drozdov <denys.drozdov@toradex.com>2022-01-10 14:19:41 +0200
committerDenys Drozdov <denys.drozdov@toradex.com>2022-01-10 14:19:41 +0200
commitb9b41da981217b17e1e9171a781c65ae8dde1688 (patch)
treea687d6a640218d96f79c186265bdd9fb16c88a28 /drivers/nvmem
parente99f775ed2f46b225106f0a156116a0080d16740 (diff)
parent4f508aa9dd3bde7a1c5e4e6de72abb8a03fd504a (diff)
Merge tag 'v5.4.155' into HEAD
This is the 5.4.155 stable release
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 6da270e8c674..c0f4324d8f7c 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -954,7 +954,8 @@ static void nvmem_shift_read_buffer_in_place(struct nvmem_cell *cell, void *buf)
*p-- = 0;
/* clear msb bits if any leftover in the last byte */
- *p &= GENMASK((cell->nbits%BITS_PER_BYTE) - 1, 0);
+ if (cell->nbits % BITS_PER_BYTE)
+ *p &= GENMASK((cell->nbits % BITS_PER_BYTE) - 1, 0);
}
static int __nvmem_cell_read(struct nvmem_device *nvmem,