dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: lixiaokeng <lixiaokeng@huawei.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>,
	Martin Wilck <mwilck@suse.com>,
	Benjamin Marzinski <bmarzins@redhat.com>,
	dm-devel mailing list <dm-devel@redhat.com>
Cc: linfeilong <linfeilong@huawei.com>,
	"liuzhiqiang (I)" <liuzhiqiang26@huawei.com>
Subject: [PATCH 2/6] libmultipath: check udev* return value in ccw_sysfs_pathinfo
Date: Tue, 15 Sep 2020 12:39:59 +0800	[thread overview]
Message-ID: <cf6ba543-dd8d-cbc9-b69d-a4e9efd0c7f9@huawei.com> (raw)
In-Reply-To: <d89bc33d-8e5d-d194-3b26-83ff4d170c5c@huawei.com>

We check the return value of udev_device_get_sysname.

Signed-off-by:Lixiaokeng<lixiaokeng@huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Linfeilong <linfeilong@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,
-- 

  parent reply	other threads:[~2020-09-15  4:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15  4:38 [PATCH 0/6] libmultipath: check udev* func return value lixiaokeng
2020-09-15  4:39 ` [PATCH 1/6] libmultipath: check uedv* return value in sysfs_get_host_pci_name lixiaokeng
2020-09-18  7:34   ` Martin Wilck
2020-09-15  4:39 ` lixiaokeng [this message]
2020-09-18  7:01   ` [PATCH 2/6] libmultipath: check udev* return value in ccw_sysfs_pathinfo Martin Wilck
2020-09-15  4:40 ` [PATCH 3/6] libmultipath: check udev* return value in sysfs_get_tgt_nodename lixiaokeng
2020-09-15  4:41 ` [PATCH 4/6] libmultipath: check udev* return value in trigger_partitions_udev_change lixiaokeng
2020-09-15  4:41 ` [PATCH 5/6] libmultipath: check udev* renturn value in get_ctrl_blkdev lixiaokeng
2020-09-18  6:59   ` Martin Wilck
2020-09-15  4:42 ` [PATCH 6/6] libmultipath: check udev* return value in _find_path_by_syspath lixiaokeng
2020-09-18  6:58   ` Martin Wilck
2020-09-18  2:26 ` [PATCH 0/6] libmultipath: check udev* func return value Benjamin Marzinski
2020-09-18  7:37   ` Martin Wilck
2020-09-18  8:39     ` lixiaokeng
2020-09-18 11:15       ` Martin Wilck

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=cf6ba543-dd8d-cbc9-b69d-a4e9efd0c7f9@huawei.com \
    --to=lixiaokeng@huawei.com \
    --cc=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --cc=linfeilong@huawei.com \
    --cc=liuzhiqiang26@huawei.com \
    --cc=mwilck@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).