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,16 +32,14 @@ struct _virAccessDriverStackPrivate {
|
||||
};
|
||||
|
||||
|
||||
int virAccessDriverStackAppend(virAccessManager *manager,
|
||||
virAccessManager *child)
|
||||
void virAccessDriverStackAppend(virAccessManager *manager,
|
||||
virAccessManager *child)
|
||||
{
|
||||
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
|
||||
|
||||
VIR_EXPAND_N(priv->managers, priv->managersLen, 1);
|
||||
|
||||
priv->managers[priv->managersLen-1] = child;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "access/viraccessdriver.h"
|
||||
|
||||
|
||||
int virAccessDriverStackAppend(virAccessManager *manager,
|
||||
virAccessManager *child);
|
||||
void virAccessDriverStackAppend(virAccessManager *manager,
|
||||
virAccessManager *child);
|
||||
|
||||
extern virAccessDriver accessDriverStack;
|
||||
|
@ -164,10 +164,7 @@ virAccessManager *virAccessManagerNewStack(const char **names)
|
||||
if (!child)
|
||||
goto error;
|
||||
|
||||
if (virAccessDriverStackAppend(manager, child) < 0) {
|
||||
virObjectUnref(child);
|
||||
goto error;
|
||||
}
|
||||
virAccessDriverStackAppend(manager, child);
|
||||
}
|
||||
|
||||
return manager;
|
||||
|
Loading…
Reference in New Issue
Block a user