UPSTREAM: 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.

Change-Id: I6af93d24c33302d8911ff0021d1c1b067d2a2715
Reported-by: Coverity (CID: 131221)
Cc: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit fa9ca8a5d271e0533f61222df2bd6fd512687dbd)
This commit is contained in:
Tom Rini 2017-09-26 22:43:45 -04:00 committed by Kever Yang
parent 0757e90bee
commit b3e1edf26c
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}