mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
nodedev: mdev: Report an error when mdev path resolution fails
It might happen that virFileResolveLinkHelper fails on the lstat system call. virFileResolveLink expects the caller to report an error when it fails, however this wasn't the case for udevProcessMediatedDevice. Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
@@ -1121,8 +1121,10 @@ udevProcessMediatedDevice(struct udev_device *dev,
|
||||
if (virAsprintf(&linkpath, "%s/mdev_type", udev_device_get_syspath(dev)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virFileResolveLink(linkpath, &canonicalpath) < 0)
|
||||
if (virFileResolveLink(linkpath, &canonicalpath) < 0) {
|
||||
virReportSystemError(errno, _("failed to resolve '%s'"), linkpath);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (VIR_STRDUP(data->type, last_component(canonicalpath)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
Reference in New Issue
Block a user