]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.10
authorSasha Levin <sashal@kernel.org>
Mon, 25 Sep 2023 11:23:33 +0000 (07:23 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 25 Sep 2023 11:23:33 +0000 (07:23 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.10/gpio-tb10x-fix-an-error-handling-path-in-tb10x_gpio_.patch [new file with mode: 0644]
queue-5.10/i2c-mux-demux-pinctrl-check-the-return-value-of-devm.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/gpio-tb10x-fix-an-error-handling-path-in-tb10x_gpio_.patch b/queue-5.10/gpio-tb10x-fix-an-error-handling-path-in-tb10x_gpio_.patch
new file mode 100644 (file)
index 0000000..c2437a8
--- /dev/null
@@ -0,0 +1,48 @@
+From 586adea2e51274cda3f87c39ffd1555274097e20 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 3 Sep 2023 08:13:21 +0200
+Subject: gpio: tb10x: Fix an error handling path in tb10x_gpio_probe()
+
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+
+[ Upstream commit b547b5e52a0587e6b25ea520bf2f9e03d00cbcb6 ]
+
+If an error occurs after a successful irq_domain_add_linear() call, it
+should be undone by a corresponding irq_domain_remove(), as already done
+in the remove function.
+
+Fixes: c6ce2b6bffe5 ("gpio: add TB10x GPIO driver")
+Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpio/gpio-tb10x.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c
+index 866201cf5f65e..4a9dcaad4a6cb 100644
+--- a/drivers/gpio/gpio-tb10x.c
++++ b/drivers/gpio/gpio-tb10x.c
+@@ -195,7 +195,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
+                               handle_edge_irq, IRQ_NOREQUEST, IRQ_NOPROBE,
+                               IRQ_GC_INIT_MASK_CACHE);
+               if (ret)
+-                      return ret;
++                      goto err_remove_domain;
+               gc = tb10x_gpio->domain->gc->gc[0];
+               gc->reg_base                         = tb10x_gpio->base;
+@@ -209,6 +209,10 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
+       }
+       return 0;
++
++err_remove_domain:
++      irq_domain_remove(tb10x_gpio->domain);
++      return ret;
+ }
+ static int tb10x_gpio_remove(struct platform_device *pdev)
+-- 
+2.40.1
+
diff --git a/queue-5.10/i2c-mux-demux-pinctrl-check-the-return-value-of-devm.patch b/queue-5.10/i2c-mux-demux-pinctrl-check-the-return-value-of-devm.patch
new file mode 100644 (file)
index 0000000..460674f
--- /dev/null
@@ -0,0 +1,38 @@
+From c1168a64b0c42c825358a8a5a82900a8ccc34bf9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 3 Mar 2022 20:39:14 +0800
+Subject: i2c: mux: demux-pinctrl: check the return value of devm_kstrdup()
+
+From: Xiaoke Wang <xkernel.wang@foxmail.com>
+
+[ Upstream commit 7c0195fa9a9e263df204963f88a22b21688ffb66 ]
+
+devm_kstrdup() returns pointer to allocated string on success,
+NULL on failure. So it is better to check the return value of it.
+
+Fixes: e35478eac030 ("i2c: mux: demux-pinctrl: run properly with multiple instances")
+Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
+Signed-off-by: Wolfram Sang <wsa@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/i2c/muxes/i2c-demux-pinctrl.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/i2c/muxes/i2c-demux-pinctrl.c b/drivers/i2c/muxes/i2c-demux-pinctrl.c
+index f7a7405d4350a..8e8688e8de0fb 100644
+--- a/drivers/i2c/muxes/i2c-demux-pinctrl.c
++++ b/drivers/i2c/muxes/i2c-demux-pinctrl.c
+@@ -243,6 +243,10 @@ static int i2c_demux_pinctrl_probe(struct platform_device *pdev)
+               props[i].name = devm_kstrdup(&pdev->dev, "status", GFP_KERNEL);
+               props[i].value = devm_kstrdup(&pdev->dev, "ok", GFP_KERNEL);
++              if (!props[i].name || !props[i].value) {
++                      err = -ENOMEM;
++                      goto err_rollback;
++              }
+               props[i].length = 3;
+               of_changeset_init(&priv->chan[i].chgset);
+-- 
+2.40.1
+
index a69be66fbd6f694c5f443bad00726bf8e56c033d..d5304e7c73e4c252d130ac8536ceb55c8a9bdaa4 100644 (file)
@@ -57,3 +57,5 @@ seqlock-prefix-internal-seqcount_t-only-macros-with-.patch
 locking-seqlock-do-the-lockdep-annotation-before-loc.patch
 bnxt_en-flush-xdp-for-bnxt_poll_nitroa0-s-napi.patch
 net-rds-fix-possible-null-pointer-dereference.patch
+gpio-tb10x-fix-an-error-handling-path-in-tb10x_gpio_.patch
+i2c-mux-demux-pinctrl-check-the-return-value-of-devm.patch