From: roel kluin Date: Sat, 1 Jan 2011 18:01:51 +0000 (+0000) Subject: Staging: iio: --/++ confusion in build_channel_array() error cleanup X-Git-Tag: MMI-PSA29.97-13-9~20521^2~897 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=267024a9f6cc7f7e26ed57424d5d0c8558769b56;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Staging: iio: --/++ confusion in build_channel_array() error cleanup Fix loop: it should decrement Signed-off-by: Roel Kluin Acked-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/Documentation/iio_utils.h b/drivers/staging/iio/Documentation/iio_utils.h index 03724246b95a..4dc961ced35e 100644 --- a/drivers/staging/iio/Documentation/iio_utils.h +++ b/drivers/staging/iio/Documentation/iio_utils.h @@ -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: