diff options
author | Peter Meerwald <pmeerw@pmeerw.net> | 2012-06-25 21:13:26 (GMT) |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-06-30 09:12:28 (GMT) |
commit | ce7b04c629254b884baa338730021b01298be921 (patch) | |
tree | 3b19199b6527a706636427dd6ad1cb47c76540d6 /drivers/staging/iio | |
parent | a4d429e362d873414046c78724f3d6a7978bc2fd (diff) | |
download | linux-fsl-qoriq-ce7b04c629254b884baa338730021b01298be921.tar.xz |
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>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/Documentation/iio_utils.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/iio/Documentation/iio_utils.h b/drivers/staging/iio/Documentation/iio_utils.h index 81a6289..b38e81f 100644 --- a/drivers/staging/iio/Documentation/iio_utils.h +++ b/drivers/staging/iio/Documentation/iio_utils.h @@ -524,6 +524,7 @@ inline int _write_sysfs_int(char *filename, char *basedir, int val, int verify) goto error_free; } fscanf(sysfsfp, "%d", &test); + fclose(sysfsfp); if (test != val) { printf("Possible failure in int write %d to %s%s\n", val, @@ -573,6 +574,7 @@ int _write_sysfs_string(char *filename, char *basedir, char *val, int verify) goto error_free; } fscanf(sysfsfp, "%s", temp); + fclose(sysfsfp); if (strcmp(temp, val) != 0) { printf("Possible failure in string write of %s " "Should be %s " |