ipv4: fix NULL checking in devinet_ioctl()
The NULL pointer check `!ifa' should come before its first use.
[ Bug origin : commit fd23c3b311
(ipv4: Add hash table of interface addresses) in linux-2.6.39 ]
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ae62ca7b03
commit
c7e2e1d72e
@ -823,9 +823,9 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)
|
|||||||
if (!ifa) {
|
if (!ifa) {
|
||||||
ret = -ENOBUFS;
|
ret = -ENOBUFS;
|
||||||
ifa = inet_alloc_ifa();
|
ifa = inet_alloc_ifa();
|
||||||
INIT_HLIST_NODE(&ifa->hash);
|
|
||||||
if (!ifa)
|
if (!ifa)
|
||||||
break;
|
break;
|
||||||
|
INIT_HLIST_NODE(&ifa->hash);
|
||||||
if (colon)
|
if (colon)
|
||||||
memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ);
|
memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user