rtnetlink: remove an unneeded test
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 14 Aug 2013 09:35:42 +0000 (12:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Aug 2013 08:29:02 +0000 (01:29 -0700)
We know that "dev" is a valid pointer at this point, so we can remove
the test and clean up a little.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c

index 0b2972c59b97824f24a96c899e906a9371ea84ab..242084edb6584900f2e457e548ec458c5a3d71a6 100644 (file)
@@ -1867,10 +1867,10 @@ replay:
                else
                        err = register_netdevice(dev);
 
-               if (err < 0 && !IS_ERR(dev))
+               if (err < 0) {
                        free_netdev(dev);
-               if (err < 0)
                        goto out;
+               }
 
                err = rtnl_configure_link(dev, ifm);
                if (err < 0)