mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-22 22:13:18 +00:00
util: Fixing invalid error checking from virPCIGetNetname()
The @linkdev is In/Out function parameter as second order
reference pointer so requires first order dereference for
checking NULL which can be the result of virPCIGetNetName().
Fixes: d6ee56d723
(util: change virPCIGetNetName() to not return error if device has no net name)
Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
Signed-off-by: dann frazier <dann.frazier@canonical.com>
This commit is contained in:
parent
8fac64db5e
commit
04983c3c6a
@ -314,7 +314,7 @@ virHostdevNetDevice(virDomainHostdevDefPtr hostdev,
|
|||||||
if (virPCIGetNetName(sysfs_path, 0, NULL, linkdev) < 0)
|
if (virPCIGetNetName(sysfs_path, 0, NULL, linkdev) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!linkdev) {
|
if (!(*linkdev)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("The device at %s has no network device name"),
|
_("The device at %s has no network device name"),
|
||||||
sysfs_path);
|
sysfs_path);
|
||||||
|
Loading…
Reference in New Issue
Block a user