mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
hyperv: Change return type of hypervCheckParams to void
This function return value is invariant since VIR_EXPAND_N check
removal in 7d2fd6e
, so change its type and remove all dependent checks.
Found by Linux Verification Center (linuxtesting.org) with Svace.
Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
f3179d5abe
commit
abd9887b6c
@ -184,14 +184,12 @@ hypervFreeInvokeParams(hypervInvokeParamsList *params)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline int
|
static inline void
|
||||||
hypervCheckParams(hypervInvokeParamsList *params)
|
hypervCheckParams(hypervInvokeParamsList *params)
|
||||||
{
|
{
|
||||||
if (params->nbParams + 1 > params->nbAvailParams) {
|
if (params->nbParams + 1 > params->nbAvailParams) {
|
||||||
VIR_EXPAND_N(params->params, params->nbAvailParams, 5);
|
VIR_EXPAND_N(params->params, params->nbAvailParams, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -212,8 +210,7 @@ hypervAddSimpleParam(hypervInvokeParamsList *params, const char *name,
|
|||||||
{
|
{
|
||||||
hypervParam *p = NULL;
|
hypervParam *p = NULL;
|
||||||
|
|
||||||
if (hypervCheckParams(params) < 0)
|
hypervCheckParams(params);
|
||||||
return -1;
|
|
||||||
|
|
||||||
p = ¶ms->params[params->nbParams];
|
p = ¶ms->params[params->nbParams];
|
||||||
p->type = HYPERV_SIMPLE_PARAM;
|
p->type = HYPERV_SIMPLE_PARAM;
|
||||||
@ -245,8 +242,7 @@ hypervAddEprParam(hypervInvokeParamsList *params,
|
|||||||
{
|
{
|
||||||
hypervParam *p = NULL;
|
hypervParam *p = NULL;
|
||||||
|
|
||||||
if (hypervCheckParams(params) < 0)
|
hypervCheckParams(params);
|
||||||
return -1;
|
|
||||||
|
|
||||||
p = ¶ms->params[params->nbParams];
|
p = ¶ms->params[params->nbParams];
|
||||||
p->type = HYPERV_EPR_PARAM;
|
p->type = HYPERV_EPR_PARAM;
|
||||||
@ -333,8 +329,7 @@ hypervAddEmbeddedParam(hypervInvokeParamsList *params,
|
|||||||
{
|
{
|
||||||
hypervParam *p = NULL;
|
hypervParam *p = NULL;
|
||||||
|
|
||||||
if (hypervCheckParams(params) < 0)
|
hypervCheckParams(params);
|
||||||
return -1;
|
|
||||||
|
|
||||||
p = ¶ms->params[params->nbParams];
|
p = ¶ms->params[params->nbParams];
|
||||||
p->type = HYPERV_EMBEDDED_PARAM;
|
p->type = HYPERV_EMBEDDED_PARAM;
|
||||||
|
Loading…
Reference in New Issue
Block a user