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:
6b16351
)
iio staging: fix potential resource leak in generic_buffer
author
Peter Meerwald
<pmeerw@pmeerw.net>
Mon, 25 Jun 2012 21:13:24 +0000
(23:13 +0200)
committer
Jonathan Cameron
<jic23@kernel.org>
Sat, 30 Jun 2012 09:12:21 +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
6f3a392
..
ab78859
100644
(file)
--- a/
drivers/staging/iio/Documentation/iio_utils.h
+++ b/
drivers/staging/iio/Documentation/iio_utils.h
@@
-157,7
+157,8
@@
inline int iioutils_get_type(unsigned *is_signed,
&padint, shift);
if (ret < 0) {
printf("failed to pass scan type description\n");
- return ret;
+ ret = -errno;
+ goto error_close_sysfsfp;
}
*be = (endianchar == 'b');
*bytes = padint / 8;
@@
-173,7
+174,11
@@
inline int iioutils_get_type(unsigned *is_signed,
free(filename);
filename = 0;
+ sysfsfp = 0;
}
+error_close_sysfsfp:
+ if (sysfsfp)
+ fclose(sysfsfp);
error_free_filename:
if (filename)
free(filename);