diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2022-01-20 16:52:43 -0600 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-01-23 18:03:37 +0000 |
commit | 2d255ec5100570559550ed61dd4c9c57d593e9a9 (patch) | |
tree | 1eb74636d7c97293fae01015b62829a89e11ad05 /kernel/trace | |
parent | c39010ea6ba13bdf0003bd353e1d4c663aaac0a8 (diff) |
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>
Diffstat (limited to 'kernel/trace')
0 files changed, 0 insertions, 0 deletions