提交 04983c3c 编写于 作者: R Radoslaw Biernacki 提交者: Michal Privoznik

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: d6ee56d7 (util: change virPCIGetNetName() to not return error if device has no net name)
Signed-off-by: NRadoslaw Biernacki <radoslaw.biernacki@linaro.org>
Signed-off-by: Ndann frazier <dann.frazier@canonical.com>
上级 8fac64db
...@@ -314,7 +314,7 @@ virHostdevNetDevice(virDomainHostdevDefPtr hostdev, ...@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册