net/net: Clean up variable shadowing in net_client_init()
Variable int err in inner scope shadows Error *err in outer scope.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20191205174635.18758-3-vsementsov@virtuozzo.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
diff --git a/net/net.c b/net/net.c
index 84aa6d8..9e93c3f 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1126,16 +1126,13 @@
prefix_addr = substrings[0];
- if (substrings[1]) {
- /* User-specified prefix length. */
- int err;
-
- err = qemu_strtoul(substrings[1], NULL, 10, &prefix_len);
- if (err) {
- error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
- "ipv6-prefixlen", "a number");
- goto out;
- }
+ /* Handle user-specified prefix length. */
+ if (substrings[1] &&
+ qemu_strtoul(substrings[1], NULL, 10, &prefix_len))
+ {
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+ "ipv6-prefixlen", "a number");
+ goto out;
}
qemu_opt_set(opts, "ipv6-prefix", prefix_addr, &error_abort);