iio: adc: mcp3911: fix sizeof() vs ARRAY_SIZE() bug
This code uses sizeof() instead of ARRAY_SIZE() so it reads beyond the end of the mcp3911_osr_table[] array. Fixes: 6d965885 ("iio: adc: mcp3911: add support for oversampling ratio") Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Reviewed-by: NMarcus Folkesson <marcus.folkesson@gmail.com> Link: https://lore.kernel.org/r/YzFsjY3xLHUQMjVr@kiliSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Showing
想要评论请 注册 或 登录