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>
{
int fd = -1;
size_t dataLen = 0;
- int ret = 0;
g_autoptr(virPCIVPDResource) res = NULL;
/* Note: Custom fields are supposed to be freed by the resource cleanup code. */
if (!res) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
"The resource pointer is NULL after parsing which is unexpected");
- return ret;
+ return -1;
}
if (!res->ro) {
return -1;
custom = NULL;
- return ret;
+ return 0;
}
static int