dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [dm-devel] [PATCH] libmultipath: call udev_device_unref before return
@ 2020-10-22  7:30 lixiaokeng
  2020-11-01 20:04 ` Martin Wilck
  0 siblings, 1 reply; 2+ messages in thread
From: lixiaokeng @ 2020-10-22  7:30 UTC (permalink / raw)
  To: Christophe Varoqui, Martin Wilck, Benjamin Marzinski,
	dm-devel mailing list
  Cc: linfeilong, liuzhiqiang (I)

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@huawei.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);
-- 

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [dm-devel] [PATCH] libmultipath: call udev_device_unref before return
  2020-10-22  7:30 [dm-devel] [PATCH] libmultipath: call udev_device_unref before return lixiaokeng
@ 2020-11-01 20:04 ` Martin Wilck
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Wilck @ 2020-11-01 20:04 UTC (permalink / raw)
  To: lixiaokeng, Christophe Varoqui, Benjamin Marzinski,
	dm-devel mailing list
  Cc: linfeilong, liuzhiqiang (I)

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@huawei.com>

Reviewed-by: Martin Wilck <mwilck@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);


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-01 20:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22  7:30 [dm-devel] [PATCH] libmultipath: call udev_device_unref before return lixiaokeng
2020-11-01 20:04 ` Martin Wilck

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).