diff options
author | Karel Zak | 2015-08-05 12:59:16 +0200 |
---|---|---|
committer | Karel Zak | 2015-08-05 12:59:16 +0200 |
commit | e820595b8153235005e99c5ef1aeb7c12ecae403 (patch) | |
tree | 02550e9dfa646883b73436a37960ec314c0aac96 | |
parent | libfdisk: remove impossible condition [smatch scan] (diff) | |
download | kernel-qcow2-util-linux-e820595b8153235005e99c5ef1aeb7c12ecae403.tar.gz kernel-qcow2-util-linux-e820595b8153235005e99c5ef1aeb7c12ecae403.tar.xz kernel-qcow2-util-linux-e820595b8153235005e99c5ef1aeb7c12ecae403.zip |
libfdisk: (gpt) fix label pointer usage [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | libfdisk/src/gpt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c index 429dcc72d..b5bbbf705 100644 --- a/libfdisk/src/gpt.c +++ b/libfdisk/src/gpt.c @@ -1942,8 +1942,10 @@ static int gpt_verify_disklabel(struct fdisk_context *cxt) assert(fdisk_is_label(cxt, GPT)); gpt = self_label(cxt); + if (!gpt) + return -EINVAL; - if (!gpt || !gpt->bheader) { + if (!gpt->bheader) { nerror++; fdisk_warnx(cxt, _("Disk does not contain a valid backup header.")); } |