diff options
author | Darren Jenkins <darrenrjenkins@gmail.com> | 2008-11-06 15:53:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-11-06 18:41:20 -0500 |
commit | 52e9d9f4b32a3bec91feb76c84e37b7dcffe5040 (patch) | |
tree | 00720ba55750b14ad8e48c3953577b636ec67404 | |
parent | 53472bc8f810d2fb507593ea03703670506a668d (diff) |
fat: cleanup fat_parse_long() error handling
Coverity CID 2332 & 2333 RESOURCE_LEAK
In fat_search_long() if fat_parse_long() returns a -ve value we return
without first freeing unicode. This patch free's them on this error path.
The above was false positive on current tree, but this change is more
clean, so apply as cleanup.
[hirofumi@mail.parknet.co.jp: fix coding style]
Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/fat/dir.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/fat/dir.c b/fs/fat/dir.c index 931dd28b5289..140fc39e2307 100644 --- a/fs/fat/dir.c +++ b/fs/fat/dir.c | |||
@@ -373,9 +373,10 @@ parse_record: | |||
373 | if (de->attr == ATTR_EXT) { | 373 | if (de->attr == ATTR_EXT) { |
374 | int status = fat_parse_long(inode, &cpos, &bh, &de, | 374 | int status = fat_parse_long(inode, &cpos, &bh, &de, |
375 | &unicode, &nr_slots); | 375 | &unicode, &nr_slots); |
376 | if (status < 0) | 376 | if (status < 0) { |
377 | return status; | 377 | err = status; |
378 | else if (status == PARSE_INVALID) | 378 | goto end_of_dir; |
379 | } else if (status == PARSE_INVALID) | ||
379 | continue; | 380 | continue; |
380 | else if (status == PARSE_NOT_LONGNAME) | 381 | else if (status == PARSE_NOT_LONGNAME) |
381 | goto parse_record; | 382 | goto parse_record; |