mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-08 22:39:56 +00:00
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: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
7b6116fb89
commit
6a8c174902
@ -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,
|
|||||||
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();
|
||||||
|
Loading…
Reference in New Issue
Block a user