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:
parent
4a5200ac8b
commit
267024a9f6
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue