diff options
author | Jesper Juhl <jj@chaosbits.net> | 2010-12-12 22:18:15 (GMT) |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-01-06 16:53:53 (GMT) |
commit | a4264b3f4049ae7aeeb0017f8158119e22fa354f (patch) | |
tree | 51d24bb133431b9bc1effb1067436b6e786f2274 /fs/udf/namei.c | |
parent | 4651c5900e7a3c84d4b70412f8bbc40c1bcb50cf (diff) | |
download | linux-fsl-qoriq-a4264b3f4049ae7aeeb0017f8158119e22fa354f.tar.xz |
UDF: Close small mem leak in udf_find_entry()
Hi,
There's a small memory leak in fs/udf/namei.c::udf_find_entry().
We dynamically allocate memory for 'fname' with kmalloc() and in most
situations we free it before we leave the function, but there is one
situation where we do not (but should). This patch closes the leak by
jumping to the 'out_ok' label which does the correct cleanup rather than
doing half the cleanup and returning directly.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/namei.c')
-rw-r--r-- | fs/udf/namei.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index a2974f7..2be0f9e 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -227,10 +227,8 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir, } if ((cfi->fileCharacteristics & FID_FILE_CHAR_PARENT) && - isdotdot) { - brelse(epos.bh); - return fi; - } + isdotdot) + goto out_ok; if (!lfi) continue; |