staging: iio: generic_buffer: initialize ret
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Mon, 7 Oct 2013 12:42:00 +0000 (13:42 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sat, 12 Oct 2013 11:19:50 +0000 (12:19 +0100)
The `ret´ variable is only initialized in the error case. For some reason
it was always != 0 while I played with generic_buffer so here is a patch.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/Documentation/iio_utils.h

index cf32ae099cd68aef662b78f92936cd8cfc657265..35154d60faf6120813bb26bf2477994e66fd259f 100644 (file)
@@ -502,7 +502,7 @@ inline int find_type_by_name(const char *name, const char *type)
 
 inline int _write_sysfs_int(char *filename, char *basedir, int val, int verify)
 {
-       int ret;
+       int ret = 0;
        FILE *sysfsfp;
        int test;
        char *temp = malloc(strlen(basedir) + strlen(filename) + 2);