All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - cov: validata top_lv
Date: Sat,  6 May 2023 20:46:06 +0000 (GMT)	[thread overview]
Message-ID: <20230506204606.4EBC63858D35@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=242bf56413f67dc3dd16770d420ced06eed0c4be
Commit:        242bf56413f67dc3dd16770d420ced06eed0c4be
Parent:        fae0ed8f10bc5771423f2b7af63690800de1ce9f
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Wed Apr 26 13:44:52 2023 +0200
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Sat May 6 19:22:05 2023 +0200

cov: validata top_lv

Add explicit pointer check is never NULL.
---
 lib/metadata/lv_manip.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 2dfa3c77b..8975bf180 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5951,6 +5951,11 @@ static void _setup_params_for_extend_metadata(struct logical_volume *lv,
 
 static int _lv_resize_check_used(struct logical_volume *lv)
 {
+	if (!lv) {
+		log_error(INTERNAL_ERROR "LV is not specified.");
+		return 0;
+	}
+
 	if (lv_is_locked(lv)) {
 		log_error("Can't resize locked logical volume %s.", display_lvname(lv));
 		return 0;


                 reply	other threads:[~2023-05-06 20:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20230506204606.4EBC63858D35@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.