[RTNETLINK]: Possible dereference in net/core/rtnetlink.c
authorEric Sesterhenn <snakebyte@gmx.de>
Wed, 27 Sep 2006 06:26:38 +0000 (23:26 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 29 Sep 2006 01:01:23 +0000 (18:01 -0700)
another possible dereference spotted by coverity (#cid 1390).
if the nlmsg_parse() call fails, we goto errout, where we call
dev_put(), with dev still initialized to NULL.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c

index d8e25e08cb7e7b725b3cc5cfb6e34cdf67a11532..221e4038216b8da1e61a67b32087eb146b02af3c 100644 (file)
@@ -562,7 +562,7 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
 
        err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy);
        if (err < 0)
-               goto errout;
+               return err;
 
        ifm = nlmsg_data(nlh);
        if (ifm->ifi_index >= 0) {