[dm-devel] [PATCH 3/4] libmultipath: warn about NULL value of mpp->hwe
mwilck at suse.com
mwilck at suse.com
Mon Jul 13 11:07:42 UTC 2020
From: Martin Wilck <mwilck at suse.com>
mpp->hwe is only accessed in propsel.c. It may become unset if
all paths of the mpp have been deleted. Access to mpp->hwe in this
case should be avoided.
Signed-off-by: Martin Wilck <mwilck at suse.com>
---
libmultipath/propsel.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
index 897e48c..92b0595 100644
--- a/libmultipath/propsel.c
+++ b/libmultipath/propsel.c
@@ -65,7 +65,9 @@ do { \
__do_set_from_vec(struct hwentry, var, (src)->hwe, dest)
#define do_set_from_hwe(var, src, dest, msg) \
- if (__do_set_from_hwe(var, src, dest)) { \
+ if (!src->hwe) { \
+ condlog(0, "BUG: do_set_from_hwe called with hwe == NULL"); \
+ } else if (__do_set_from_hwe(var, src, dest)) { \
origin = msg; \
goto out; \
}
--
2.26.2
More information about the dm-devel
mailing list