diff options
author | Josh Boyer <jwboyer@redhat.com> | 2013-09-20 15:17:52 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-21 00:15:42 +0200 |
commit | 607566aeccde6ffccde5eef173ed0d277eec4a2d (patch) | |
tree | 641c6d622098fe69df3d9d59131376cdfb7d4004 /fs/jbd2 | |
parent | lockref: use cmpxchg64 explicitly for lockless updates (diff) | |
download | linux-607566aeccde6ffccde5eef173ed0d277eec4a2d.tar.xz linux-607566aeccde6ffccde5eef173ed0d277eec4a2d.zip |
CacheFiles: Fix memory leak in cachefiles_check_auxdata error paths
In cachefiles_check_auxdata(), we allocate auxbuf but fail to free it if
we determine there's an error or that the data is stale.
Further, assigning the output of vfs_getxattr() to auxbuf->len gives
problems with checking for errors as auxbuf->len is a u16. We don't
actually need to set auxbuf->len, so keep the length in a variable for
now. We shouldn't need to check the upper limit of the buffer as an
overflow there should be indicated by -ERANGE.
While we're at it, fscache_check_aux() returns an enum value, not an
int, so assign it to an appropriately typed variable rather than to ret.
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Hongyi Jia <jiayisuse@gmail.com>
cc: Milosz Tanski <milosz@adfin.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/jbd2')
0 files changed, 0 insertions, 0 deletions