[dm-devel] [PATCH] libmultipath: call udev_device_unref before return
Martin Wilck
mwilck at suse.com
Sun Nov 1 20:04:29 UTC 2020
On Thu, 2020-10-22 at 15:30 +0800, lixiaokeng wrote:
> There is a bug in commit acff7d4. Before return, we should call
> udev_device_unref(hostdev) in sysfs_get_tgt_nodenam.
>
> Signed-off_by:lixiaokeng <lxiiaokeng at huawei.com>
Reviewed-by: Martin Wilck <mwilck at suse.com>
> ---
> libmultipath/discovery.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
> index 193d7127..c2e1754c 100644
> --- a/libmultipath/discovery.c
> +++ b/libmultipath/discovery.c
> @@ -518,8 +518,10 @@ int sysfs_get_host_pci_name(const struct path
> *pp, char *pci_name)
> */
> value = udev_device_get_sysname(parent);
>
> - if (!value)
> + if (!value) {
> + udev_device_unref(hostdev);
> return 1;
> + }
>
> strncpy(pci_name, value, SLOT_NAME_SIZE);
> udev_device_unref(hostdev);
More information about the dm-devel
mailing list