[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a36c25243e848f5f6e5622369.ps@mail.parknet.co.jp>
Date: Wed, 15 Oct 2008 22:57:57 +0900
From: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To: akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, hirofumi@...l.parknet.co.jp,
darrenrjenkins@...il.com
Subject: [PATCH 06/21] fat: cleanup fat_parse_long() error handling
From: "Darren Jenkins" <darrenrjenkins@...il.com>
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@...l.parknet.co.jp: fix coding style]
Signed-off-by: Darren Jenkins <darrenrjenkins@...il.com>
Signed-off-by: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
---
fs/fat/dir.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff -puN fs/fat/dir.c~fat_fat_parse_long-cleanup fs/fat/dir.c
--- linux-2.6/fs/fat/dir.c~fat_fat_parse_long-cleanup 2008-08-24 23:14:01.000000000 +0900
+++ linux-2.6-hirofumi/fs/fat/dir.c 2008-08-24 23:14:01.000000000 +0900
@@ -373,9 +373,10 @@ parse_record:
if (de->attr == ATTR_EXT) {
int status = fat_parse_long(inode, &cpos, &bh, &de,
&unicode, &nr_slots);
- if (status < 0)
- return status;
- else if (status == PARSE_INVALID)
+ if (status < 0) {
+ err = status;
+ goto end_of_dir;
+ } else if (status == PARSE_INVALID)
continue;
else if (status == PARSE_NOT_LONGNAME)
goto parse_record;
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists