[libvirt PATCH v2 06/15] network: eliminate unnecessary labels

Ján Tomko jtomko at redhat.com
Tue Jul 21 13:07:45 UTC 2020


On a Tuesday in 2020, John Ferlan wrote:
>
>
>On 7/7/20 5:08 PM, Laine Stump wrote:
>> All these cleanup/error labels were reduced to having just "return
>> ret" by a previous patch, so get rid of them and return directly.
>>
>> Signed-off-by: Laine Stump <laine at redhat.com>
>> ---
>>  src/network/bridge_driver.c       | 264 ++++++++++++------------------
>>  src/network/bridge_driver_linux.c |  15 +-
>>  2 files changed, 113 insertions(+), 166 deletions(-)
>>
>> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
>> index 31bd0dd92c..79b2ca3330 100644
>> --- a/src/network/bridge_driver.c
>> +++ b/src/network/bridge_driver.c
>
>[...]
>
>Coverity noted there's a leak with this part of the change for @field...
>
>>
>> @@ -2207,7 +2164,6 @@ networkSetIPv6Sysctls(virNetworkObjPtr obj)
>>  {
>>      virNetworkDefPtr def = virNetworkObjGetDef(obj);
>>      g_autofree char *field = NULL;
>> -    int ret = -1;
>>      bool enableIPv6 = !!virNetworkDefGetIPByIndex(def, AF_INET6, 0);
>>
>>      /* set disable_ipv6 if there are no ipv6 addresses defined for the
>> @@ -2221,15 +2177,14 @@ networkSetIPv6Sysctls(virNetworkObjPtr obj)
>>          if (!enableIPv6)
>>              VIR_DEBUG("ipv6 appears to already be disabled on %s",
>>                        def->bridge);
>> -        ret = 0;
>> -        goto cleanup;
>> +        return 0;
>>      }
>
>Below here doesn't match w/ current source, but I assume you know that.
>Looks like a mis-merge with the review from the previous patch.
>

Should be fixed in git master by:
commit 5c50d1dda5664d480e6370111c0218947706bd31
Author:     Ján Tomko <jtomko at redhat.com>
CommitDate: 2020-07-21 14:55:00 +0200

     network: split out networkSetIPv6Sysctl

https://gitlab.com/libvirt/libvirt/-/commit/5c50d1dda5664d480e6370111c0218947706bd31

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200721/c2ffbc70/attachment-0001.sig>


More information about the libvir-list mailing list