Staging: iio: --/++ confusion in build_channel_array() error cleanup
authorroel kluin <roel.kluin@gmail.com>
Sat, 1 Jan 2011 18:01:51 +0000 (18:01 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 Jan 2011 23:58:17 +0000 (15:58 -0800)
Fix loop: it should decrement

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/Documentation/iio_utils.h

index 03724246b95ad8a6bd350f18cc76a4f69c0d3900..4dc961ced35e2b7791f3e88afe69da386162aeef 100644 (file)
@@ -398,7 +398,7 @@ inline int build_channel_array(const char *device_dir,
        return 0;
 
 error_cleanup_array:
-       for (i = count - 1;  i >= 0; i++)
+       for (i = count - 1;  i >= 0; i--)
                free((*ci_array)[i].name);
        free(*ci_array);
 error_close_dir: