libmultipath: call udev_device_unref before return
PATCH 1/1 libmultipath: call udev_device_unref before return
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 <[email protected]>
--- libmultipath/discovery.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
libmultipath/discovery.c +3 -1
@@ -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);
Signature · 4 lines
-- dm-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/dm-devel
Quoted 4 lines · lixiaokeng
There is a bug in commit acff7d4. Before return, we should call
udev_device_unref(hostdev)insysfs_get_tgt_nodenam.Signed-off_by:lixiaokeng <[email protected]>
Reviewed-by Martin Wilck <[email protected]>
Quoted 20 lines
--- libmultipath/discovery.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)libmultipath/discovery.c +3
-1@@ -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 );
Quoted 1 line
udev_device_unref(hostdev);
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel