Commit 267024a9 authored by roel kluin's avatar roel kluin Committed by Greg Kroah-Hartman

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

Fix loop: it should decrement
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Acked-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4a5200ac
...@@ -398,7 +398,7 @@ inline int build_channel_array(const char *device_dir, ...@@ -398,7 +398,7 @@ inline int build_channel_array(const char *device_dir,
return 0; return 0;
error_cleanup_array: 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)[i].name);
free(*ci_array); free(*ci_array);
error_close_dir: error_close_dir:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment