Removes unnecessary if statement check for net device. Error check performed
after alloc_netdev().
ndev = alloc_netdev(sizeof(*sdata) + local->hw.vif_data_size, name,
NET_NAME_UNKNOWN, ieee802154_if_setup);
if (!ndev)
return ERR_PTR(-ENOMEM);
..
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
if (ret)
goto err;
- if (ndev) {
- ret = register_netdevice(ndev);
- if (ret < 0)
- goto err;
- }
+ ret = register_netdevice(ndev);
+ if (ret < 0)
+ goto err;
mutex_lock(&local->iflist_mtx);
list_add_tail_rcu(&sdata->list, &local->interfaces);