Commit fa232332 authored by Peter Oskolkov's avatar Peter Oskolkov Committed by David S. Miller

selftests: net: reuseport_addr_any: silence clang warning

Clang does not recognize that calls to error() terminate execution
and complains about uninitialized variable use that happens after calls
to error(). This noop patchset fixes this.
Signed-off-by: default avatarPeter Oskolkov <posk@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a02e8964
...@@ -60,6 +60,11 @@ static void build_rcv_fd(int family, int proto, int *rcv_fds, int count, ...@@ -60,6 +60,11 @@ static void build_rcv_fd(int family, int proto, int *rcv_fds, int count,
break; break;
default: default:
error(1, 0, "Unsupported family %d", family); error(1, 0, "Unsupported family %d", family);
/* clang does not recognize error() above as terminating
* the program, so it complains that saddr, sz are
* not initialized when this code path is taken. Silence it.
*/
return;
} }
for (i = 0; i < count; ++i) { for (i = 0; i < count; ++i) {
...@@ -128,6 +133,11 @@ static int connect_and_send(int family, int proto) ...@@ -128,6 +133,11 @@ static int connect_and_send(int family, int proto)
break; break;
default: default:
error(1, 0, "Unsupported family %d", family); error(1, 0, "Unsupported family %d", family);
/* clang does not recognize error() above as terminating
* the program, so it complains that saddr, daddr, sz are
* not initialized when this code path is taken. Silence it.
*/
return -1;
} }
fd = socket(family, proto, 0); fd = socket(family, proto, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment