We check the return value of udev_device_get_sysname.

Signed-off-by:Lixiaokeng<lixiaok...@huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqian...@huawei.com>
Signed-off-by: Linfeilong <linfeil...@huawei.com>
---
 libmultipath/discovery.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 4264b0da..27cb67f8 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1471,6 +1471,8 @@ ccw_sysfs_pathinfo (struct path *pp, const struct _vector 
*hwtable)
         * host / bus / target / lun
         */
        attr_path = udev_device_get_sysname(parent);
+       if (attr_path)
+               return PATHINFO_FAILED;
        pp->sg_id.lun = 0;
        if (sscanf(attr_path, "%i.%i.%x",
                   &pp->sg_id.host_no,
-- 

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to