[dm-devel] [PATCH 2/6] libmultipath: check udev* return value in ccw_sysfs_pathinfo
Martin Wilck
mwilck at suse.com
Fri Sep 18 07:01:37 UTC 2020
On Tue, 2020-09-15 at 12:39 +0800, lixiaokeng wrote:
> We check the return value of udev_device_get_sysname.
>
> Signed-off-by:Lixiaokeng<lixiaokeng at huawei.com>
> Signed-off-by: Zhiqiang Liu <liuzhiqiang26 at huawei.com>
> Signed-off-by: Linfeilong <linfeilong at 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,
This looks wrong.
More information about the dm-devel
mailing list