From 3fd38416e7a4817d18173cdebd5b4c5d62c06220 Mon Sep 17 00:00:00 2001 From: Bastian Germann Date: Sun, 8 Sep 2019 21:59:22 +0200 Subject: ubiupdatevol: Prevent null pointer dereference 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 Signed-off-by: David Oberhollenzer --- ubi-utils/ubiupdatevol.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'ubi-utils') diff --git a/ubi-utils/ubiupdatevol.c b/ubi-utils/ubiupdatevol.c index bdcc091..1b3239e 100644 --- a/ubi-utils/ubiupdatevol.c +++ b/ubi-utils/ubiupdatevol.c @@ -308,9 +308,7 @@ int main(int argc, char * const argv[]) 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); -- cgit v1.2.3