mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
access: Change return type of virAccessDriverStackAppend 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
da2439b746
commit
393b0471a7
@ -32,7 +32,7 @@ struct _virAccessDriverStackPrivate {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int virAccessDriverStackAppend(virAccessManager *manager,
|
void virAccessDriverStackAppend(virAccessManager *manager,
|
||||||
virAccessManager *child)
|
virAccessManager *child)
|
||||||
{
|
{
|
||||||
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
|
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
|
||||||
@ -40,8 +40,6 @@ int virAccessDriverStackAppend(virAccessManager *manager,
|
|||||||
VIR_EXPAND_N(priv->managers, priv->managersLen, 1);
|
VIR_EXPAND_N(priv->managers, priv->managersLen, 1);
|
||||||
|
|
||||||
priv->managers[priv->managersLen-1] = child;
|
priv->managers[priv->managersLen-1] = child;
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "access/viraccessdriver.h"
|
#include "access/viraccessdriver.h"
|
||||||
|
|
||||||
|
|
||||||
int virAccessDriverStackAppend(virAccessManager *manager,
|
void virAccessDriverStackAppend(virAccessManager *manager,
|
||||||
virAccessManager *child);
|
virAccessManager *child);
|
||||||
|
|
||||||
extern virAccessDriver accessDriverStack;
|
extern virAccessDriver accessDriverStack;
|
||||||
|
@ -164,10 +164,7 @@ virAccessManager *virAccessManagerNewStack(const char **names)
|
|||||||
if (!child)
|
if (!child)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virAccessDriverStackAppend(manager, child) < 0) {
|
virAccessDriverStackAppend(manager, child);
|
||||||
virObjectUnref(child);
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return manager;
|
return manager;
|
||||||
|
Loading…
Reference in New Issue
Block a user