Unverified Commit 4f42e95a authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!7965 nvmem: Fix shift-out-of-bound (UBSAN) with byte size cells

parents c49c5abf adcd445b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1061,6 +1061,7 @@ 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 */
	if (cell->nbits % BITS_PER_BYTE)
		*p &= GENMASK((cell->nbits % BITS_PER_BYTE) - 1, 0);
}