Home
last modified time | relevance | path

Searched hist:"2 d255ec5" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/iio/buffer/
H A Dindustrialio-hw-consumer.c2d255ec5 Thu Jan 20 16:52:43 CST 2022 Gustavo A. R. Silva <gustavoars@kernel.org> iio: hw_consumer: Use struct_size() helper in kzalloc()

Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows that,
in the worst scenario, could lead to heap overflows.

Also, address the following sparse warnings:
drivers/iio/buffer/industrialio-hw-consumer.c:63:23: warning: using sizeof on a flexible structure when using CF='-Wflexible-array-sizeof'

Link: https://github.com/KSPP/linux/issues/174
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220120225243.GA37225@embeddedor
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>