This is an automated email from the ASF dual-hosted git repository.

jacobrosenthal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new a82f5bf  adc driver impl: correct incoming arg check (#800)
a82f5bf is described below

commit a82f5bfbf10e11bf64afbaceb22403708d8e943f
Author: Jacob Rosenthal <jacobrosent...@gmail.com>
AuthorDate: Wed Feb 14 07:57:37 2018 -0700

    adc driver impl: correct incoming arg check (#800)
---
 hw/drivers/adc/src/adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/drivers/adc/src/adc.c b/hw/drivers/adc/src/adc.c
index 5eb3440..14b93f7 100644
--- a/hw/drivers/adc/src/adc.c
+++ b/hw/drivers/adc/src/adc.c
@@ -36,7 +36,7 @@ adc_chan_config(struct adc_dev *dev, uint8_t cnum, void *data)
 {
     assert(dev->ad_funcs.af_configure_channel != NULL);
 
-    if (cnum > dev->ad_chan_count) {
+    if (cnum >= dev->ad_chan_count) {
         return (EINVAL);
     }
 
@@ -57,7 +57,7 @@ adc_chan_read(struct adc_dev *dev, uint8_t cnum, int *result)
 {
     assert(dev->ad_funcs.af_read_channel != NULL);
 
-    if (cnum > dev->ad_chan_count) {
+    if (cnum >= dev->ad_chan_count) {
         return (EINVAL);
     }
 

-- 
To stop receiving notification emails like this one, please contact
jacobrosent...@apache.org.

Reply via email to