Skip to content

Commit

Permalink
net: remove an unneeded check
Browse files Browse the repository at this point in the history
"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>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Jul 31, 2013
1 parent b438f94 commit 4299c8a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 4299c8a

Please sign in to comment.