projects
/
profile
/
ivi
/
kernel-adaptation-intel-automotive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a4d429e
)
iio staging: fix resource leak in _write_sysfs_int()
author
Peter Meerwald
<pmeerw@pmeerw.net>
Mon, 25 Jun 2012 21:13:26 +0000
(23:13 +0200)
committer
Jonathan Cameron
<jic23@kernel.org>
Sat, 30 Jun 2012 09:12:28 +0000
(10:12 +0100)
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/Documentation/iio_utils.h
patch
|
blob
|
history
diff --git
a/drivers/staging/iio/Documentation/iio_utils.h
b/drivers/staging/iio/Documentation/iio_utils.h
index
81a6289
..
b38e81f
100644
(file)
--- 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 "