net: remove an unneeded check
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 29 Jul 2013 19:15:19 +0000 (22:15 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Jul 2013 02:24:16 +0000 (19:24 -0700)
"ifa->ifa_label" is an array inside the in_ifaddr struct.  It can never
be NULL so we can remove this check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/devinet.c

index 8d48c392adccec6dc1f2ca8e3c8fd5a6750283e5..1b7f7ae8514a5a08ee10e94cfb234686bc3182a9 100644 (file)
@@ -1124,10 +1124,7 @@ static int inet_gifconf(struct net_device *dev, char __user *buf, int len)
                if (len < (int) sizeof(ifr))
                        break;
                memset(&ifr, 0, sizeof(struct ifreq));
-               if (ifa->ifa_label)
-                       strcpy(ifr.ifr_name, ifa->ifa_label);
-               else
-                       strcpy(ifr.ifr_name, dev->name);
+               strcpy(ifr.ifr_name, ifa->ifa_label);
 
                (*(struct sockaddr_in *)&ifr.ifr_addr).sin_family = AF_INET;
                (*(struct sockaddr_in *)&ifr.ifr_addr).sin_addr.s_addr =