]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jul 2014 20:04:07 +0000 (13:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jul 2014 20:04:07 +0000 (13:04 -0700)
added patches:
hwmon-ina2xx-cast-to-s16-on-shunt-and-current-regs.patch
mac80211-don-t-check-netdev-state-for-debugfs-read-write.patch
mac80211-fix-a-memory-leak-on-sta-rate-selection-table.patch

queue-3.10/hwmon-ina2xx-cast-to-s16-on-shunt-and-current-regs.patch [new file with mode: 0644]
queue-3.10/mac80211-don-t-check-netdev-state-for-debugfs-read-write.patch [new file with mode: 0644]
queue-3.10/mac80211-fix-a-memory-leak-on-sta-rate-selection-table.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/hwmon-ina2xx-cast-to-s16-on-shunt-and-current-regs.patch b/queue-3.10/hwmon-ina2xx-cast-to-s16-on-shunt-and-current-regs.patch
new file mode 100644 (file)
index 0000000..ef9a85e
--- /dev/null
@@ -0,0 +1,49 @@
+From c0214f98943b1fe43f7be61b7782b0c8f0836f28 Mon Sep 17 00:00:00 2001
+From: Fabio Baltieri <fabio.baltieri@gmail.com>
+Date: Sun, 8 Jun 2014 22:06:24 +0100
+Subject: hwmon: (ina2xx) Cast to s16 on shunt and current regs
+
+From: Fabio Baltieri <fabio.baltieri@gmail.com>
+
+commit c0214f98943b1fe43f7be61b7782b0c8f0836f28 upstream.
+
+All devices supported by ina2xx are bidirectional and report the
+measured shunt voltage and power values as a signed 16 bit, but the
+current driver implementation caches all registers as u16, leading
+to an incorrect sign extension when reporting to userspace in
+ina2xx_get_value().
+
+This patch fixes the problem by casting the signed registers to s16.
+Tested on an INA219.
+
+Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/hwmon/ina2xx.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/hwmon/ina2xx.c
++++ b/drivers/hwmon/ina2xx.c
+@@ -147,7 +147,8 @@ static int ina2xx_get_value(struct ina2x
+       switch (reg) {
+       case INA2XX_SHUNT_VOLTAGE:
+-              val = DIV_ROUND_CLOSEST(data->regs[reg],
++              /* signed register */
++              val = DIV_ROUND_CLOSEST((s16)data->regs[reg],
+                                       data->config->shunt_div);
+               break;
+       case INA2XX_BUS_VOLTAGE:
+@@ -159,8 +160,8 @@ static int ina2xx_get_value(struct ina2x
+               val = data->regs[reg] * data->config->power_lsb;
+               break;
+       case INA2XX_CURRENT:
+-              /* LSB=1mA (selected). Is in mA */
+-              val = data->regs[reg];
++              /* signed register, LSB=1mA (selected), in mA */
++              val = (s16)data->regs[reg];
+               break;
+       default:
+               /* programmer goofed */
diff --git a/queue-3.10/mac80211-don-t-check-netdev-state-for-debugfs-read-write.patch b/queue-3.10/mac80211-don-t-check-netdev-state-for-debugfs-read-write.patch
new file mode 100644 (file)
index 0000000..a3bd9d0
--- /dev/null
@@ -0,0 +1,43 @@
+From 923eaf367206e01f22c97aee22300e332d071916 Mon Sep 17 00:00:00 2001
+From: Arik Nemtsov <arik@wizery.com>
+Date: Mon, 26 May 2014 14:40:51 +0300
+Subject: mac80211: don't check netdev state for debugfs read/write
+
+From: Arik Nemtsov <arik@wizery.com>
+
+commit 923eaf367206e01f22c97aee22300e332d071916 upstream.
+
+Doing so will lead to an oops for a p2p-dev interface, since it has
+no netdev.
+
+Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
+Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/mac80211/debugfs_netdev.c |    6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/net/mac80211/debugfs_netdev.c
++++ b/net/mac80211/debugfs_netdev.c
+@@ -34,8 +34,7 @@ static ssize_t ieee80211_if_read(
+       ssize_t ret = -EINVAL;
+       read_lock(&dev_base_lock);
+-      if (sdata->dev->reg_state == NETREG_REGISTERED)
+-              ret = (*format)(sdata, buf, sizeof(buf));
++      ret = (*format)(sdata, buf, sizeof(buf));
+       read_unlock(&dev_base_lock);
+       if (ret >= 0)
+@@ -62,8 +61,7 @@ static ssize_t ieee80211_if_write(
+       ret = -ENODEV;
+       rtnl_lock();
+-      if (sdata->dev->reg_state == NETREG_REGISTERED)
+-              ret = (*write)(sdata, buf, count);
++      ret = (*write)(sdata, buf, count);
+       rtnl_unlock();
+       return ret;
diff --git a/queue-3.10/mac80211-fix-a-memory-leak-on-sta-rate-selection-table.patch b/queue-3.10/mac80211-fix-a-memory-leak-on-sta-rate-selection-table.patch
new file mode 100644 (file)
index 0000000..3f2f187
--- /dev/null
@@ -0,0 +1,36 @@
+From 53d045258ee2e38b1e882617cb0799a04d05f5fa Mon Sep 17 00:00:00 2001
+From: Felix Fietkau <nbd@openwrt.org>
+Date: Tue, 27 May 2014 22:33:57 +0200
+Subject: mac80211: fix a memory leak on sta rate selection table
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Felix Fietkau <nbd@openwrt.org>
+
+commit 53d045258ee2e38b1e882617cb0799a04d05f5fa upstream.
+
+If the rate control algorithm uses a selection table, it
+is leaked when the station is destroyed - fix that.
+
+Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+Reported-by: Christophe Prévotaux <cprevotaux@nltinc.com>
+Fixes: 0d528d85c519 ("mac80211: improve the rate control API")
+[add commit log entry, remove pointless NULL check]
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/mac80211/sta_info.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/net/mac80211/sta_info.c
++++ b/net/mac80211/sta_info.c
+@@ -270,6 +270,7 @@ void sta_info_free(struct ieee80211_loca
+       sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr);
++      kfree(rcu_dereference_raw(sta->sta.rates));
+       kfree(sta);
+ }
index c3a1a0e1ae3bbb71450717a7e93c9b4851abd1bf..12b043c04abcb6ef642947b9a6784027eb04a0df 100644 (file)
@@ -24,3 +24,6 @@ bluetooth-fix-locking-of-hdev-when-calling-into-smp-code.patch
 dm-thin-update-discard_granularity-to-reflect-the-thin-pool-blocksize.patch
 rbd-use-reference-counts-for-image-requests.patch
 rbd-handle-parent_overlap-on-writes-correctly.patch
+hwmon-ina2xx-cast-to-s16-on-shunt-and-current-regs.patch
+mac80211-don-t-check-netdev-state-for-debugfs-read-write.patch
+mac80211-fix-a-memory-leak-on-sta-rate-selection-table.patch