mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
PCI VPD: Fix a wrong return code in a test case
The test case should return -1, not 0 in case a valid resource could not be parsed successfully but the ret value is initialized to 0. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>
This commit is contained in:
parent
600f580d62
commit
935fbcf9da
@ -537,7 +537,6 @@ testVirPCIVPDParseFullVPD(const void *opaque G_GNUC_UNUSED)
|
|||||||
{
|
{
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
size_t dataLen = 0;
|
size_t dataLen = 0;
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
g_autoptr(virPCIVPDResource) res = NULL;
|
g_autoptr(virPCIVPDResource) res = NULL;
|
||||||
/* Note: Custom fields are supposed to be freed by the resource cleanup code. */
|
/* Note: Custom fields are supposed to be freed by the resource cleanup code. */
|
||||||
@ -558,7 +557,7 @@ testVirPCIVPDParseFullVPD(const void *opaque G_GNUC_UNUSED)
|
|||||||
if (!res) {
|
if (!res) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
"The resource pointer is NULL after parsing which is unexpected");
|
"The resource pointer is NULL after parsing which is unexpected");
|
||||||
return ret;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!res->ro) {
|
if (!res->ro) {
|
||||||
@ -596,7 +595,7 @@ testVirPCIVPDParseFullVPD(const void *opaque G_GNUC_UNUSED)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
custom = NULL;
|
custom = NULL;
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user