diff options
author | Varka Bhadram <varkabhadram@gmail.com> | 2014-11-25 06:04:43 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-26 00:00:13 -0500 |
commit | 473f3766b5c2145f4c70bed39f4595b15c889ae2 (patch) | |
tree | ce41c1b081dfe1cc8c25beec709c0e542dec910d /net/mac802154 | |
parent | 69bb631ef9505df1eb4123bc01d2218f7b48c577 (diff) |
mac802154: remove unnecessary if statement
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>
Diffstat (limited to 'net/mac802154')
-rw-r--r-- | net/mac802154/iface.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index 38dfc72d24b6..9ae893057dd7 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c | |||
@@ -510,11 +510,9 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name, | |||
510 | if (ret) | 510 | if (ret) |
511 | goto err; | 511 | goto err; |
512 | 512 | ||
513 | if (ndev) { | 513 | ret = register_netdevice(ndev); |
514 | ret = register_netdevice(ndev); | 514 | if (ret < 0) |
515 | if (ret < 0) | 515 | goto err; |
516 | goto err; | ||
517 | } | ||
518 | 516 | ||
519 | mutex_lock(&local->iflist_mtx); | 517 | mutex_lock(&local->iflist_mtx); |
520 | list_add_tail_rcu(&sdata->list, &local->interfaces); | 518 | list_add_tail_rcu(&sdata->list, &local->interfaces); |