Skip to contentSkip to conversation

fs/ext4/ext4fs.c: Free dirnode in error path of ext4fs_ls

PATCH In review Tom Rini 1 participant 2 messages Sep 27, 2017 – Oct 7, 2017 ext4 file system

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 fs/ext4/ext4fs.c: Free dirnode in error path of ext4fs_ls

As reported by Coverity, we did not free dirnode in the case of failure. Do so now.

Reported-by Coverity (CID: 131221)
Cc Stefan Brüns <[email protected]>
---
 fs/ext4/ext4fs.c | 1 +
 1 file changed, 1 insertion(+)
fs/ext4/ext4fs.c +1 -0
index 081509dbb4db..b0c7303aa410 100644
@@ -167,6 +167,7 @@ int ext4fs_ls(const char *dirname)
 				  FILETYPE_DIRECTORY);
 	if (status != 1) {
 		printf("** Can not find directory. **\n");
+		ext4fs_free_node(dirnode, &ext4fs_root->diropen);
 		return 1;
 	}
 
Signature · 1 line
1.9.1
author
#1 lore raw
Quoted 6 lines · Tom Rini

As reported by Coverity, we did not free dirnode in the case of failure. Do so now.

Reported-by Coverity (CID: 131221)
Cc Stefan Brüns <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171007/9847769f/attachment.sig>