From: Martin Wilck <[email protected]>

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 <[email protected]>
---
 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


--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to