]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Mon, 25 Dec 2023 00:41:26 +0000 (19:41 -0500)
committerSasha Levin <sashal@kernel.org>
Mon, 25 Dec 2023 00:41:26 +0000 (19:41 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/iio-imu-inv_mpu6050-fix-an-error-code-problem-in-inv.patch [new file with mode: 0644]
queue-4.14/input-ipaq-micro-keys-add-error-handling-for-devm_km.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/iio-imu-inv_mpu6050-fix-an-error-code-problem-in-inv.patch b/queue-4.14/iio-imu-inv_mpu6050-fix-an-error-code-problem-in-inv.patch
new file mode 100644 (file)
index 0000000..e72965c
--- /dev/null
@@ -0,0 +1,45 @@
+From f749b7b7a5c423fe84a9e845e477b6b57359efac Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 30 Oct 2023 10:02:19 +0800
+Subject: iio: imu: inv_mpu6050: fix an error code problem in
+ inv_mpu6050_read_raw
+
+From: Su Hui <suhui@nfschina.com>
+
+[ Upstream commit c3df0e29fb7788c4b3ddf37d5ed87dda2b822943 ]
+
+inv_mpu6050_sensor_show() can return -EINVAL or IIO_VAL_INT. Return the
+true value rather than only return IIO_VAL_INT.
+
+Fixes: d5098447147c ("iio: imu: mpu6050: add calibration offset support")
+Signed-off-by: Su Hui <suhui@nfschina.com>
+Link: https://lore.kernel.org/r/20231030020218.65728-1-suhui@nfschina.com
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+index 44830bce13dfe..689dfd1ef98b4 100644
+--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
++++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+@@ -421,13 +421,13 @@ inv_mpu6050_read_raw(struct iio_dev *indio_dev,
+                       ret = inv_mpu6050_sensor_show(st, st->reg->gyro_offset,
+                                               chan->channel2, val);
+                       mutex_unlock(&st->lock);
+-                      return IIO_VAL_INT;
++                      return ret;
+               case IIO_ACCEL:
+                       mutex_lock(&st->lock);
+                       ret = inv_mpu6050_sensor_show(st, st->reg->accl_offset,
+                                               chan->channel2, val);
+                       mutex_unlock(&st->lock);
+-                      return IIO_VAL_INT;
++                      return ret;
+               default:
+                       return -EINVAL;
+-- 
+2.43.0
+
diff --git a/queue-4.14/input-ipaq-micro-keys-add-error-handling-for-devm_km.patch b/queue-4.14/input-ipaq-micro-keys-add-error-handling-for-devm_km.patch
new file mode 100644 (file)
index 0000000..68ef729
--- /dev/null
@@ -0,0 +1,40 @@
+From e64ce68a15f7e55cea3d6259c82e5916a4a08312 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 3 Dec 2023 19:00:23 +0000
+Subject: Input: ipaq-micro-keys - add error handling for devm_kmemdup
+
+From: Haoran Liu <liuhaoran14@163.com>
+
+[ Upstream commit 59b6a747e2d39227ac2325c5e29d6ab3bb070c2a ]
+
+Check the return value of i2c_add_adapter. Static analysis revealed that
+the function did not properly handle potential failures of
+i2c_add_adapter, which could lead to partial initialization of the I2C
+adapter and unstable operation.
+
+Signed-off-by: Haoran Liu <liuhaoran14@163.com>
+Link: https://lore.kernel.org/r/20231203164653.38983-1-liuhaoran14@163.com
+Fixes: d7535ffa427b ("Input: driver for microcontroller keys on the iPaq h3xxx")
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/input/keyboard/ipaq-micro-keys.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/input/keyboard/ipaq-micro-keys.c b/drivers/input/keyboard/ipaq-micro-keys.c
+index 602900d1f9378..2d0d09ee9ab08 100644
+--- a/drivers/input/keyboard/ipaq-micro-keys.c
++++ b/drivers/input/keyboard/ipaq-micro-keys.c
+@@ -108,6 +108,9 @@ static int micro_key_probe(struct platform_device *pdev)
+       keys->codes = devm_kmemdup(&pdev->dev, micro_keycodes,
+                          keys->input->keycodesize * keys->input->keycodemax,
+                          GFP_KERNEL);
++      if (!keys->codes)
++              return -ENOMEM;
++
+       keys->input->keycode = keys->codes;
+       __set_bit(EV_KEY, keys->input->evbit);
+-- 
+2.43.0
+
index 33d420418e8db7dde9ce50a7aaac0d2b5b3b687c..8f12617961d2b8ce7c03d236aef1f8f480784d60 100644 (file)
@@ -5,3 +5,5 @@ net-sched-ife-fix-potential-use-after-free.patch
 ethernet-atheros-fix-a-memleak-in-atl1e_setup_ring_r.patch
 net-check-vlan-filter-feature-in-vlan_vids_add_by_de.patch
 pinctrl-at91-pio4-use-dedicated-lock-class-for-irq.patch
+iio-imu-inv_mpu6050-fix-an-error-code-problem-in-inv.patch
+input-ipaq-micro-keys-add-error-handling-for-devm_km.patch