]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip-link: remove warning message
authorZhang Shengju <zhangshengju@cmss.chinamobile.com>
Thu, 21 Jan 2016 02:23:49 +0000 (02:23 +0000)
committerStephen Hemminger <shemming@brocade.com>
Tue, 2 Feb 2016 04:57:43 +0000 (15:57 +1100)
the warning was:
iproute.c:301:12: warning: 'val' may be used uninitialized in this
function [-Wmaybe-uninitialized]
   features &= ~RTAX_FEATURE_ECN;
            ^
iproute.c:575:10: note: 'val' was declared here
   __u32 val;
  ^

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
ip/iproute.c

index d5e3ebe262ae9ee6b802df868a31b96c28e14975..afe70e123cc4ddb40f51c6fb53dcb1387ddaba9a 100644 (file)
@@ -572,7 +572,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                        mxlock = *(unsigned*)RTA_DATA(mxrta[RTAX_LOCK]);
 
                for (i=2; i<= RTAX_MAX; i++) {
-                       __u32 val;
+                       __u32 val = 0U;
 
                        if (mxrta[i] == NULL)
                                continue;