Fix leaks in ISOFS.
PATCH 1/1 Fix leaks in ISOFS.
Spotted with the source checker from Coverity.com.
Signed-off-by Dave Jones <[email protected]>
fs/isofs/rock.c +3 -1
@@ -153,6 +153,7 @@ int get_rock_ridge_filename(struct iso_d } }MAYBE_CONTINUE (repeat,inode); +if (buffer)kfree (buffer);return retnamlen;/* If 0, this file did not have a NM field */ out:if (buffer)kfree (buffer);
@@ -351,7 +352,6 @@ int parse_rock_ridge_inode_internal(stru } }MAYBE_CONTINUE (repeat,inode); -return 0 ; out:if (buffer)kfree (buffer);return 0 ;
@@ -515,6 +515,8 @@ static int rock_ridge_symlink_readpage(s } }MAYBE_CONTINUE (repeat, inode); +if (buffer) +kfree (buffer);if (rpnt == link) goto fail;
Quoted 2 lines
MAYBE_CONTINUE(repeat,inode);+ if (buffer) kfree(buffer);
kfree(NULL) is just fine
Quoted 4 lines · Christoph Hellwig
Quoted 2 lines
MAYBE_CONTINUE(repeat,inode);+ if (buffer) kfree(buffer);
kfree(NULL) is just fine
True. I got carried away mirroring the style of all the other kfree operations in that code.
Dave