Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild
[powerpc.git] / net / wanrouter / wanmain.c
index 13b650a..c34833d 100644 (file)
@@ -44,6 +44,7 @@
 
 #include <linux/config.h>
 #include <linux/stddef.h>      /* offsetof(), etc. */
+#include <linux/capability.h>
 #include <linux/errno.h>       /* return codes */
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -714,10 +715,8 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
        }
 
        /* This code has moved from del_if() function */
-       if (dev->priv) {
-               kfree(dev->priv);
-               dev->priv = NULL;
-       }
+       kfree(dev->priv);
+       dev->priv = NULL;
 
 #ifdef CONFIG_WANPIPE_MULTPPP
        if (cnf->config_id == WANCONFIG_MPPP)
@@ -851,10 +850,8 @@ static int wanrouter_delete_interface(struct wan_device *wandev, char *name)
 
        /* Due to new interface linking method using dev->priv,
         * this code has moved from del_if() function.*/
-       if (dev->priv){
-               kfree(dev->priv);
-               dev->priv=NULL;
-       }
+       kfree(dev->priv);
+       dev->priv=NULL;
 
        unregister_netdev(dev);