tools: env: Fix missing closedir in ubi_get_volnum_by_name
PATCH 1/1 tools: env: Fix missing closedir in ubi_get_volnum_by_name
The function calls opendir() but missing the corresponding closedir() before exit the function.
Add missing closedir() to fix it.
Signed-off-by Miaoqian Lin <[email protected]>
--- tools/env/fw_env.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tools/env/fw_env.c +4 -1
@@ -192,10 +192,13 @@ static int ubi_get_volnum_by_name(int devnum, const char *volname) &tmp_devnum, &volnum);if (ret ==2 && devnum == tmp_devnum) {if (ubi_check_volume_sysfs_name (dirent->d_name, - volname) ==0 ) + volname) ==0 ) { +closedir (sysfs_ubi);return volnum; + } } } +closedir (sysfs_ubi);return -1 ; }
Signature · 1 line
2.25.1
Quoted 5 lines · Miaoqian Lin
The function calls
opendir()but missing the correspondingclosedir()before exit the function.
Add missingclosedir()to fix it.Signed-off-by Miaoqian Lin <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom