projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7812bf1
)
fix the leak in integrity_read_file()
author
Al Viro
<viro@zeniv.linux.org.uk>
Fri, 25 Dec 2015 22:59:12 +0000
(17:59 -0500)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Mon, 4 Jan 2016 15:28:19 +0000
(10:28 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
security/integrity/iint.c
patch
|
blob
|
blame
|
history
diff --git
a/security/integrity/iint.c
b/security/integrity/iint.c
index 3d2f5b45c8cbeb0b376749adab00985b7a636f6f..c2e3ccd4b51044ae368271f0b4bce9b6630271f5 100644
(file)
--- a/
security/integrity/iint.c
+++ b/
security/integrity/iint.c
@@
-234,12
+234,13
@@
int __init integrity_read_file(const char *path, char **data)
}
rc = integrity_kernel_read(file, 0, buf, size);
- if (rc < 0)
- kfree(buf);
- else if (rc != size)
- rc = -EIO;
- else
+ if (rc == size) {
*data = buf;
+ } else {
+ kfree(buf);
+ if (rc >= 0)
+ rc = -EIO;
+ }
out:
fput(file);
return rc;