|
|
bbaaef |
From 600a018ea1136e184b421c86da170b35d05e949f Mon Sep 17 00:00:00 2001
|
|
|
bbaaef |
Message-Id: <600a018ea1136e184b421c86da170b35d05e949f.1578588395.git.lorenzo.bianconi@redhat.com>
|
|
|
bbaaef |
From: Han Zhou <hzhou@ovn.org>
|
|
|
bbaaef |
Date: Wed, 30 Oct 2019 12:38:34 -0700
|
|
|
bbaaef |
Subject: [PATCH 1/3] pinctrl.c: Fix maybe-uninitialized warnings with old GCC
|
|
|
bbaaef |
versions.
|
|
|
bbaaef |
MIME-Version: 1.0
|
|
|
bbaaef |
Content-Type: text/plain; charset=UTF-8
|
|
|
bbaaef |
Content-Transfer-Encoding: 8bit
|
|
|
bbaaef |
|
|
|
bbaaef |
There are warnings with older GCC versions (e.g. 4.9.2):
|
|
|
bbaaef |
===
|
|
|
bbaaef |
../controller/pinctrl.c: In function ‘ipv6_ra_send’:
|
|
|
bbaaef |
../controller/pinctrl.c:2393:13: error: ‘r1’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
|
|
|
bbaaef |
memcpy(&dnssl[i], t1, strlen(t1));
|
|
|
bbaaef |
^
|
|
|
bbaaef |
../controller/pinctrl.c:2383:20: note: ‘r1’ was declared here
|
|
|
bbaaef |
char *t1, *r1;
|
|
|
bbaaef |
^
|
|
|
bbaaef |
===
|
|
|
bbaaef |
This is not a real problem but compile fails because of it. This patch
|
|
|
bbaaef |
fixes it by initializing the pointers to NULL, to avoid the warnings
|
|
|
bbaaef |
with older GCC.
|
|
|
bbaaef |
|
|
|
bbaaef |
CC: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
|
|
|
bbaaef |
Fixes: 5a12a940f63a ("Add DNSSL support to OVN")
|
|
|
bbaaef |
Acked-by: Numan Siddique <nusiddiq@redhat.com>
|
|
|
bbaaef |
Signed-off-by: Han Zhou <hzhou@ovn.org>
|
|
|
bbaaef |
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
|
|
|
bbaaef |
---
|
|
|
bbaaef |
ovn/controller/pinctrl.c | 4 ++--
|
|
|
bbaaef |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
bbaaef |
|
|
|
bbaaef |
diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
|
|
|
bbaaef |
index ae1b8e1ca..04ccb25a8 100644
|
|
|
bbaaef |
--- a/ovn/controller/pinctrl.c
|
|
|
bbaaef |
+++ b/ovn/controller/pinctrl.c
|
|
|
bbaaef |
@@ -2422,7 +2422,7 @@ packet_put_ra_dnssl_opt(struct dp_packet *b, ovs_be32 lifetime,
|
|
|
bbaaef |
size_t prev_l4_size = dp_packet_l4_size(b);
|
|
|
bbaaef |
size_t size = sizeof(struct ovs_nd_dnssl);
|
|
|
bbaaef |
struct ip6_hdr *nh = dp_packet_l3(b);
|
|
|
bbaaef |
- char *t0, *r0, dnssl[255] = {};
|
|
|
bbaaef |
+ char *t0, *r0 = NULL, dnssl[255] = {};
|
|
|
bbaaef |
int i = 0;
|
|
|
bbaaef |
|
|
|
bbaaef |
/* Multiple DNS Search List must be 'comma' separated
|
|
|
bbaaef |
@@ -2433,7 +2433,7 @@ packet_put_ra_dnssl_opt(struct dp_packet *b, ovs_be32 lifetime,
|
|
|
bbaaef |
*/
|
|
|
bbaaef |
for (t0 = strtok_r(dnssl_list, ",", &r0;; t0;
|
|
|
bbaaef |
t0 = strtok_r(NULL, ",", &r0)) {
|
|
|
bbaaef |
- char *t1, *r1;
|
|
|
bbaaef |
+ char *t1, *r1 = NULL;
|
|
|
bbaaef |
|
|
|
bbaaef |
size += strlen(t0) + 2;
|
|
|
bbaaef |
if (size > sizeof(dnssl)) {
|
|
|
bbaaef |
--
|
|
|
bbaaef |
2.21.1
|
|
|
bbaaef |
|