iio staging: fix resource leak in _write_sysfs_int()
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
a4d429e362
commit
ce7b04c629
1 changed files with 2 additions and 0 deletions
|
@ -524,6 +524,7 @@ inline int _write_sysfs_int(char *filename, char *basedir, int val, int verify)
|
||||||
goto error_free;
|
goto error_free;
|
||||||
}
|
}
|
||||||
fscanf(sysfsfp, "%d", &test);
|
fscanf(sysfsfp, "%d", &test);
|
||||||
|
fclose(sysfsfp);
|
||||||
if (test != val) {
|
if (test != val) {
|
||||||
printf("Possible failure in int write %d to %s%s\n",
|
printf("Possible failure in int write %d to %s%s\n",
|
||||||
val,
|
val,
|
||||||
|
@ -573,6 +574,7 @@ int _write_sysfs_string(char *filename, char *basedir, char *val, int verify)
|
||||||
goto error_free;
|
goto error_free;
|
||||||
}
|
}
|
||||||
fscanf(sysfsfp, "%s", temp);
|
fscanf(sysfsfp, "%s", temp);
|
||||||
|
fclose(sysfsfp);
|
||||||
if (strcmp(temp, val) != 0) {
|
if (strcmp(temp, val) != 0) {
|
||||||
printf("Possible failure in string write of %s "
|
printf("Possible failure in string write of %s "
|
||||||
"Should be %s "
|
"Should be %s "
|
||||||
|
|
Loading…
Add table
Reference in a new issue