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:
Alexander Kuznetsov 2024-11-28 18:21:17 +03:00 committed by Jiri Denemark
parent da2439b746
commit 393b0471a7
3 changed files with 5 additions and 10 deletions

View File

@ -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;
} }

View File

@ -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;

View File

@ -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;