Staging: iio: --/++ confusion in build_channel_array() error cleanup

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>
This commit is contained in:
roel kluin 2011-01-01 18:01:51 +00:00 committed by Greg Kroah-Hartman
parent 4a5200ac8b
commit 267024a9f6
1 changed files with 1 additions and 1 deletions

View 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: