Linux-mtd Archive on
 help / color / Atom feed
From: Bastian Germann <>
Cc: Bastian Germann <>
Subject: [PATCH] ubiupdatevol: Prevent null pointer dereference
Date: Sun,  8 Sep 2019 21:59:22 +0200
Message-ID: <> (raw)

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

Signed-off-by: Bastian Germann <>
 ubi-utils/ubiupdatevol.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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);

Linux MTD discussion mailing list

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-08 19:59 Bastian Germann [this message]
2019-09-10  8:19 ` David Oberhollenzer

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-mtd Archive on

Archives are clonable:
	git clone --mirror linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ \
	public-inbox-index linux-mtd

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox