All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - integrity: fix segfault for lv with no seg
Date: Wed,  2 Sep 2020 14:16:39 +0000 (GMT)	[thread overview]
Message-ID: <20200902141639.CF4AB388C02B@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9a7b81fb7262dbd896b74bc76a98f070a9309fed
Commit:        9a7b81fb7262dbd896b74bc76a98f070a9309fed
Parent:        739827ef1c1a256114aa0b2a385baa0983fac289
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Wed Sep 2 09:15:58 2020 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Wed Sep 2 09:15:58 2020 -0500

integrity: fix segfault for lv with no seg

in lv_raid_has_integrity
---
 lib/metadata/integrity_manip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/metadata/integrity_manip.c b/lib/metadata/integrity_manip.c
index 6b2d352a7..5854a2a52 100644
--- a/lib/metadata/integrity_manip.c
+++ b/lib/metadata/integrity_manip.c
@@ -847,7 +847,8 @@ int lv_raid_has_integrity(struct logical_volume *lv)
 	struct lv_segment *seg, *seg_image;
 	uint32_t s;
 
-	seg = first_seg(lv);
+	if (!(seg = first_seg(lv)))
+		return 0;
 
 	if (seg_is_raid(seg)) {
 		for (s = 0; s < seg->area_count; s++) {



                 reply	other threads:[~2020-09-02 14:16 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=20200902141639.CF4AB388C02B@sourceware.org \
    --to=teigland@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.