Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1734279
| From | Fabrice Gasnier <fabrice.gasnier@st.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] iio: adc: stm32: fix bad error check on max_channels |
| Date | 2017-09-18 18:30 +0200 |
| Message-ID | <ur75L-b2-19@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Fix a bad error check when counting 'st,adc-channels' array elements.
This is seen when all channels are in use simultaneously.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
drivers/iio/adc/stm32-adc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
index e3c15f8..4df32cf 100644
--- a/drivers/iio/adc/stm32-adc.c
+++ b/drivers/iio/adc/stm32-adc.c
@@ -1666,7 +1666,7 @@ static int stm32_adc_chan_of_init(struct iio_dev *indio_dev)
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;
}
--
1.9.1
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] iio: adc: stm32: fix bad error check on max_channels Fabrice Gasnier <fabrice.gasnier@st.com> - 2017-09-18 18:30 +0200 Re: [PATCH] iio: adc: stm32: fix bad error check on max_channels Jonathan Cameron <jic23@kernel.org> - 2017-09-24 15:10 +0200
csiph-web