提交 6a8c1749 编写于 作者: M Michal Privoznik

virPCIGetNetName: Initialize @netname to NULL

This is a return argument that is to be compared against NULL on
successful return. However, it is not initialized and therefore
relies on callers setting it to NULL prior calling the function.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 7b6116fb
...@@ -1445,8 +1445,6 @@ virNetDevGetVirtualFunctionInfo(const char *vfname, char **pfname, ...@@ -1445,8 +1445,6 @@ virNetDevGetVirtualFunctionInfo(const char *vfname, char **pfname,
{ {
int ret = -1; int ret = -1;
*pfname = NULL;
if (virNetDevGetPhysicalFunction(vfname, pfname) < 0) if (virNetDevGetPhysicalFunction(vfname, pfname) < 0)
return -1; return -1;
......
...@@ -2853,6 +2853,8 @@ virPCIGetNetName(const char *device_link_sysfs_path, ...@@ -2853,6 +2853,8 @@ virPCIGetNetName(const char *device_link_sysfs_path,
struct dirent *entry = NULL; struct dirent *entry = NULL;
size_t i = 0; size_t i = 0;
*netname = NULL;
if (virBuildPath(&pcidev_sysfs_net_path, device_link_sysfs_path, if (virBuildPath(&pcidev_sysfs_net_path, device_link_sysfs_path,
"net") == -1) { "net") == -1) {
virReportOOMError(); virReportOOMError();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册