]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jul 2012 21:58:14 +0000 (14:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jul 2012 21:58:14 +0000 (14:58 -0700)
added patches:
mwifiex-fix-wrong-return-values-in-add_virtual_intf-error-cases.patch
tracing-change-cpu-ring-buffer-state-from-tracing_cpumask.patch

queue-3.4/mwifiex-fix-wrong-return-values-in-add_virtual_intf-error-cases.patch [new file with mode: 0644]
queue-3.4/series
queue-3.4/tracing-change-cpu-ring-buffer-state-from-tracing_cpumask.patch [new file with mode: 0644]

diff --git a/queue-3.4/mwifiex-fix-wrong-return-values-in-add_virtual_intf-error-cases.patch b/queue-3.4/mwifiex-fix-wrong-return-values-in-add_virtual_intf-error-cases.patch
new file mode 100644 (file)
index 0000000..23db692
--- /dev/null
@@ -0,0 +1,91 @@
+From bzhao@marvell.com  Wed Jul 11 14:43:51 2012
+From: Bing Zhao <bzhao@marvell.com>
+Date: Tue,  3 Jul 2012 20:43:56 -0700
+Subject: mwifiex: fix wrong return values in add_virtual_intf() error cases
+To: stable@vger.kernel.org
+Cc: Johannes Berg <johannes@sipsolutions.net>, "John W. Linville" <linville@tuxdriver.com>, Bing Zhao <bzhao@marvell.com>
+Message-ID: <1341373436-4692-1-git-send-email-bzhao@marvell.com>
+
+From: Bing Zhao <bzhao@marvell.com>
+
+commit 858faa57dd9e2b91f3f870fbb1185982e42f5a2b upstream
+
+add_virtual_intf() needs to return an ERR_PTR(), instead of NULL,
+on errors, otherwise cfg80211 will crash.
+
+Reported-by: Johannes Berg <johannes@sipsolutions.net>
+Signed-off-by: Bing Zhao <bzhao@marvell.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/mwifiex/cfg80211.c |   21 +++++++++------------
+ 1 file changed, 9 insertions(+), 12 deletions(-)
+
+--- a/drivers/net/wireless/mwifiex/cfg80211.c
++++ b/drivers/net/wireless/mwifiex/cfg80211.c
+@@ -1214,11 +1214,11 @@ struct net_device *mwifiex_add_virtual_i
+       void *mdev_priv;
+       if (!priv)
+-              return NULL;
++              return ERR_PTR(-EFAULT);
+       adapter = priv->adapter;
+       if (!adapter)
+-              return NULL;
++              return ERR_PTR(-EFAULT);
+       switch (type) {
+       case NL80211_IFTYPE_UNSPECIFIED:
+@@ -1227,7 +1227,7 @@ struct net_device *mwifiex_add_virtual_i
+               if (priv->bss_mode) {
+                       wiphy_err(wiphy, "cannot create multiple"
+                                       " station/adhoc interfaces\n");
+-                      return NULL;
++                      return ERR_PTR(-EINVAL);
+               }
+               if (type == NL80211_IFTYPE_UNSPECIFIED)
+@@ -1244,14 +1244,15 @@ struct net_device *mwifiex_add_virtual_i
+               break;
+       default:
+               wiphy_err(wiphy, "type not supported\n");
+-              return NULL;
++              return ERR_PTR(-EINVAL);
+       }
+       dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name,
+                             ether_setup, 1);
+       if (!dev) {
+               wiphy_err(wiphy, "no memory available for netdevice\n");
+-              goto error;
++              priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
++              return ERR_PTR(-ENOMEM);
+       }
+       dev_net_set(dev, wiphy_net(wiphy));
+@@ -1276,7 +1277,9 @@ struct net_device *mwifiex_add_virtual_i
+       /* Register network device */
+       if (register_netdevice(dev)) {
+               wiphy_err(wiphy, "cannot register virtual network device\n");
+-              goto error;
++              free_netdev(dev);
++              priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
++              return ERR_PTR(-EFAULT);
+       }
+       sema_init(&priv->async_sem, 1);
+@@ -1288,12 +1291,6 @@ struct net_device *mwifiex_add_virtual_i
+       mwifiex_dev_debugfs_init(priv);
+ #endif
+       return dev;
+-error:
+-      if (dev && (dev->reg_state == NETREG_UNREGISTERED))
+-              free_netdev(dev);
+-      priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
+-
+-      return NULL;
+ }
+ EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf);
index 8a435f2c7fbaac4e22677ca1078cdc567bf216f0..7c1b838154885239cff955e83dc6dc249d85c0ad 100644 (file)
@@ -160,3 +160,5 @@ sunrpc-move-per-net-operations-from-svc_destroy.patch
 nfs-hard-code-init_net-for-nfs-callback-transports.patch
 mac80211-fix-queues-stuck-issue-with-ht-bandwidth-change.patch
 iwlwifi-remove-log_event-debugfs-file-debugging-is-disabled.patch
+tracing-change-cpu-ring-buffer-state-from-tracing_cpumask.patch
+mwifiex-fix-wrong-return-values-in-add_virtual_intf-error-cases.patch
diff --git a/queue-3.4/tracing-change-cpu-ring-buffer-state-from-tracing_cpumask.patch b/queue-3.4/tracing-change-cpu-ring-buffer-state-from-tracing_cpumask.patch
new file mode 100644 (file)
index 0000000..0ccc70c
--- /dev/null
@@ -0,0 +1,53 @@
+From 71babb2705e2203a64c27ede13ae3508a0d2c16c Mon Sep 17 00:00:00 2001
+From: Vaibhav Nagarnaik <vnagarnaik@google.com>
+Date: Thu, 3 May 2012 18:59:52 -0700
+Subject: tracing: change CPU ring buffer state from tracing_cpumask
+
+From: Vaibhav Nagarnaik <vnagarnaik@google.com>
+
+commit 71babb2705e2203a64c27ede13ae3508a0d2c16c upstream.
+
+According to Documentation/trace/ftrace.txt:
+
+tracing_cpumask:
+
+        This is a mask that lets the user only trace
+        on specified CPUS. The format is a hex string
+        representing the CPUS.
+
+The tracing_cpumask currently doesn't affect the tracing state of
+per-CPU ring buffers.
+
+This patch enables/disables CPU recording as its corresponding bit in
+tracing_cpumask is set/unset.
+
+Link: http://lkml.kernel.org/r/1336096792-25373-3-git-send-email-vnagarnaik@google.com
+
+Cc: Frederic Weisbecker <fweisbec@gmail.com>
+Cc: Ingo Molnar <mingo@redhat.com>
+Cc: Laurent Chavey <chavey@google.com>
+Cc: Justin Teravest <teravest@google.com>
+Cc: David Sharp <dhsharp@google.com>
+Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/trace/trace.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/kernel/trace/trace.c
++++ b/kernel/trace/trace.c
+@@ -2648,10 +2648,12 @@ tracing_cpumask_write(struct file *filp,
+               if (cpumask_test_cpu(cpu, tracing_cpumask) &&
+                               !cpumask_test_cpu(cpu, tracing_cpumask_new)) {
+                       atomic_inc(&global_trace.data[cpu]->disabled);
++                      ring_buffer_record_disable_cpu(global_trace.buffer, cpu);
+               }
+               if (!cpumask_test_cpu(cpu, tracing_cpumask) &&
+                               cpumask_test_cpu(cpu, tracing_cpumask_new)) {
+                       atomic_dec(&global_trace.data[cpu]->disabled);
++                      ring_buffer_record_enable_cpu(global_trace.buffer, cpu);
+               }
+       }
+       arch_spin_unlock(&ftrace_max_lock);