From: lixiaokeng Subject: [PATCH 2/6] libmultipath: check udev* return value in ccw_sysfs_pathinfo Date: Tue, 15 Sep 2020 12:39:59 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Content-Language: en-GB To: Christophe Varoqui , Martin Wilck , Benjamin Marzinski , dm-devel mailing list Cc: linfeilong , "liuzhiqiang (I)" List-Id: dm-devel.ids We check the return value of udev_device_get_sysname. Signed-off-by:Lixiaokeng Signed-off-by: Zhiqiang Liu Signed-off-by: Linfeilong --- 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, --