iio: magnetometer: rm3100: add boundary check for the value read from RM3100_REG_TMRC
commit 792595ba upstream. Recently, we encounter kernel crash in function rm3100_common_probe caused by out of bound access of array rm3100_samp_rates (because of underlying hardware failures). Add boundary check to prevent out of bound access. Fixes: 121354b2 ("iio: magnetometer: Add driver support for PNI RM3100") Suggested-by:Zhouyi Zhou <zhouzhouyi@gmail.com> Signed-off-by:
zhili.liu <zhili.liu@ucas.com.cn> Link: https://lore.kernel.org/r/1704157631-3814-1-git-send-email-zhouzhouyi@gmail.com Cc: <Stable@vger.kernel.org> Signed-off-by:
Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
parent
720d0112
Please register or sign in to comment