libubi_close(libubi) is called in the error handler if libubi is null.
Prevent that by handling the error case similar to the other ubi
executables.
Signed-off-by: Bastian Germann <bastiangermann@fishpost.de>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
if (!libubi) {
if (errno == 0)
errmsg("UBI is not present in the system");
- else
- sys_errmsg("cannot open libubi");
- goto out_libubi;
+ return sys_errmsg("cannot open libubi");
}
err = ubi_probe_node(libubi, args.node);