From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:59620 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751598AbdJIM1G (ORCPT ); Mon, 9 Oct 2017 08:27:06 -0400 Subject: Patch "iio: adc: stm32: fix bad error check on max_channels" has been added to the 4.13-stable tree To: fabrice.gasnier@st.com, Jonathan.Cameron@huawei.com, gregkh@linuxfoundation.org Cc: , From: Date: Mon, 09 Oct 2017 14:27:09 +0200 Message-ID: <150755202916950@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled iio: adc: stm32: fix bad error check on max_channels to the 4.13-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: iio-adc-stm32-fix-bad-error-check-on-max_channels.patch and it can be found in the queue-4.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 4fb840c95f82652cece7352be9080884cafb92a0 Mon Sep 17 00:00:00 2001 From: Fabrice Gasnier Date: Mon, 18 Sep 2017 18:24:15 +0200 Subject: iio: adc: stm32: fix bad error check on max_channels From: Fabrice Gasnier commit 4fb840c95f82652cece7352be9080884cafb92a0 upstream. Fix a bad error check when counting 'st,adc-channels' array elements. This is seen when all channels are in use simultaneously. Fixes: 64ad7f643 ("iio: adc: stm32: introduce compatible data cfg") Signed-off-by: Fabrice Gasnier Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/stm32-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/adc/stm32-adc.c +++ b/drivers/iio/adc/stm32-adc.c @@ -1543,7 +1543,7 @@ static int stm32_adc_chan_of_init(struct num_channels = of_property_count_u32_elems(node, "st,adc-channels"); if (num_channels < 0 || - num_channels >= adc_info->max_channels) { + num_channels > adc_info->max_channels) { dev_err(&indio_dev->dev, "Bad st,adc-channels?\n"); return num_channels < 0 ? num_channels : -EINVAL; } Patches currently in stable-queue which might be from fabrice.gasnier@st.com are queue-4.13/iio-adc-stm32-fix-bad-error-check-on-max_channels.patch queue-4.13/iio-trigger-stm32-timer-preset-shouldn-t-be-buffered.patch queue-4.13/iio-trigger-stm32-timer-fix-a-corner-case-to-write-preset.patch