aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/main.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-22 12:57:35 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-22 12:57:35 -0500
commitd2c2ad54c485e7ebca5c0b7e4a7b2c56103fda38 (patch)
tree4918ea1f5c640fd4f1a5134cc50a6cb8bd0c700e /drivers/net/wireless/mwifiex/main.c
parent7fa850ab4fc992717b3cc6284d3445c88978ca7e (diff)
parent9d8506cc2d7ea1f911c72c100193a3677f6668c3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix memory leaks and other issues in mwifiex driver, from Amitkumar Karwar. 2) skb_segment() can choke on packets using frag lists, fix from Herbert Xu with help from Eric Dumazet and others. 3) IPv4 output cached route instantiation properly handles races involving two threads trying to install the same route, but we forgot to propagate this logic to input routes as well. Fix from Alexei Starovoitov. 4) Put protections in place to make sure that recvmsg() paths never accidently copy uninitialized memory back into userspace and also make sure that we never try to use more that sockaddr_storage for building the on-kernel-stack copy of a sockaddr. Fixes from Hannes Frederic Sowa. 5) R8152 driver transmit flow bug fixes from Hayes Wang. 6) Fix some minor fallouts from genetlink changes, from Johannes Berg and Michael Opdenacker. 7) AF_PACKET sendmsg path can race with netdevice unregister notifier, fix by using RCU to make sure the network device doesn't go away from under us. Fix from Daniel Borkmann. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (43 commits) gso: handle new frag_list of frags GRO packets genetlink: fix genl_set_err() group ID genetlink: fix genlmsg_multicast() bug packet: fix use after free race in send path when dev is released xen-netback: stop the VIF thread before unbinding IRQs wimax: remove dead code net/phy: Add the autocross feature for forced links on VSC82x4 net/phy: Add VSC8662 support net/phy: Add VSC8574 support net/phy: Add VSC8234 support net: add BUG_ON if kernel advertises msg_namelen > sizeof(struct sockaddr_storage) net: rework recvmsg handler msg_name and msg_namelen logic bridge: flush br's address entry in fdb when remove the net: core: Always propagate flag changes to interfaces ipv4: fix race in concurrent ip_route_input_slow() r8152: fix incorrect type in assignment r8152: support stopping/waking tx queue r8152: modify the tx flow r8152: fix tx/rx memory overflow netfilter: ebt_ip6: fix source and destination matching ...
Diffstat (limited to 'drivers/net/wireless/mwifiex/main.c')
-rw-r--r--drivers/net/wireless/mwifiex/main.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 9d7c9d354d34..78e8a6666cc6 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -411,13 +411,14 @@ static void mwifiex_terminate_workqueue(struct mwifiex_adapter *adapter)
411 */ 411 */
412static void mwifiex_fw_dpc(const struct firmware *firmware, void *context) 412static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
413{ 413{
414 int ret, i; 414 int ret;
415 char fmt[64]; 415 char fmt[64];
416 struct mwifiex_private *priv; 416 struct mwifiex_private *priv;
417 struct mwifiex_adapter *adapter = context; 417 struct mwifiex_adapter *adapter = context;
418 struct mwifiex_fw_image fw; 418 struct mwifiex_fw_image fw;
419 struct semaphore *sem = adapter->card_sem; 419 struct semaphore *sem = adapter->card_sem;
420 bool init_failed = false; 420 bool init_failed = false;
421 struct wireless_dev *wdev;
421 422
422 if (!firmware) { 423 if (!firmware) {
423 dev_err(adapter->dev, 424 dev_err(adapter->dev,
@@ -469,14 +470,16 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
469 priv = adapter->priv[MWIFIEX_BSS_ROLE_STA]; 470 priv = adapter->priv[MWIFIEX_BSS_ROLE_STA];
470 if (mwifiex_register_cfg80211(adapter)) { 471 if (mwifiex_register_cfg80211(adapter)) {
471 dev_err(adapter->dev, "cannot register with cfg80211\n"); 472 dev_err(adapter->dev, "cannot register with cfg80211\n");
472 goto err_register_cfg80211; 473 goto err_init_fw;
473 } 474 }
474 475
475 rtnl_lock(); 476 rtnl_lock();
476 /* Create station interface by default */ 477 /* Create station interface by default */
477 if (!mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", 478 wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d",
478 NL80211_IFTYPE_STATION, NULL, NULL)) { 479 NL80211_IFTYPE_STATION, NULL, NULL);
480 if (IS_ERR(wdev)) {
479 dev_err(adapter->dev, "cannot create default STA interface\n"); 481 dev_err(adapter->dev, "cannot create default STA interface\n");
482 rtnl_unlock();
480 goto err_add_intf; 483 goto err_add_intf;
481 } 484 }
482 rtnl_unlock(); 485 rtnl_unlock();
@@ -486,17 +489,6 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
486 goto done; 489 goto done;
487 490
488err_add_intf: 491err_add_intf:
489 for (i = 0; i < adapter->priv_num; i++) {
490 priv = adapter->priv[i];
491
492 if (!priv)
493 continue;
494
495 if (priv->wdev && priv->netdev)
496 mwifiex_del_virtual_intf(adapter->wiphy, priv->wdev);
497 }
498 rtnl_unlock();
499err_register_cfg80211:
500 wiphy_unregister(adapter->wiphy); 492 wiphy_unregister(adapter->wiphy);
501 wiphy_free(adapter->wiphy); 493 wiphy_free(adapter->wiphy);
502err_init_fw: 494err_init_fw:
@@ -1006,12 +998,6 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
1006 wiphy_unregister(priv->wdev->wiphy); 998 wiphy_unregister(priv->wdev->wiphy);
1007 wiphy_free(priv->wdev->wiphy); 999 wiphy_free(priv->wdev->wiphy);
1008 1000
1009 for (i = 0; i < adapter->priv_num; i++) {
1010 priv = adapter->priv[i];
1011 if (priv)
1012 kfree(priv->wdev);
1013 }
1014
1015 mwifiex_terminate_workqueue(adapter); 1001 mwifiex_terminate_workqueue(adapter);
1016 1002
1017 /* Unregister device */ 1003 /* Unregister device */