Skip to content

Commit

Permalink
wanmain: comparing array with NULL
Browse files Browse the repository at this point in the history
gcc really should warn about these !

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alan Cox authored and David S. Miller committed Jul 24, 2012
1 parent c66b9b7 commit 8b72ff6
Showing 1 changed file with 23 additions and 28 deletions.
51 changes: 23 additions & 28 deletions net/wanrouter/wanmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,36 +602,31 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
* successfully, add it to the interface list.
*/

if (dev->name == NULL) {
err = -EINVAL;
} else {
#ifdef WANDEBUG
printk(KERN_INFO "%s: registering interface %s...\n",
wanrouter_modname, dev->name);
#endif

#ifdef WANDEBUG
printk(KERN_INFO "%s: registering interface %s...\n",
wanrouter_modname, dev->name);
#endif

err = register_netdev(dev);
if (!err) {
struct net_device *slave = NULL;
unsigned long smp_flags=0;

lock_adapter_irq(&wandev->lock, &smp_flags);

if (wandev->dev == NULL) {
wandev->dev = dev;
} else {
for (slave=wandev->dev;
DEV_TO_SLAVE(slave);
slave = DEV_TO_SLAVE(slave))
DEV_TO_SLAVE(slave) = dev;
}
++wandev->ndev;

unlock_adapter_irq(&wandev->lock, &smp_flags);
err = 0; /* done !!! */
goto out;
err = register_netdev(dev);
if (!err) {
struct net_device *slave = NULL;
unsigned long smp_flags=0;

lock_adapter_irq(&wandev->lock, &smp_flags);

if (wandev->dev == NULL) {
wandev->dev = dev;
} else {
for (slave=wandev->dev;
DEV_TO_SLAVE(slave);
slave = DEV_TO_SLAVE(slave))
DEV_TO_SLAVE(slave) = dev;
}
++wandev->ndev;

unlock_adapter_irq(&wandev->lock, &smp_flags);
err = 0; /* done !!! */
goto out;
}
if (wandev->del_if)
wandev->del_if(wandev, dev);
Expand Down

0 comments on commit 8b72ff6

Please sign in to comment.