From: Sasha Levin Date: Mon, 25 Sep 2023 11:23:36 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v6.5.6~92 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=64191ef86945b3572d9f451f5503bb04ad82d327;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/gpio-tb10x-fix-an-error-handling-path-in-tb10x_gpio_.patch b/queue-4.19/gpio-tb10x-fix-an-error-handling-path-in-tb10x_gpio_.patch new file mode 100644 index 00000000000..8dff9e37845 --- /dev/null +++ b/queue-4.19/gpio-tb10x-fix-an-error-handling-path-in-tb10x_gpio_.patch @@ -0,0 +1,48 @@ +From d16d0bf70459055157f5791cf67a249bb8f3943d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 3 Sep 2023 08:13:21 +0200 +Subject: gpio: tb10x: Fix an error handling path in tb10x_gpio_probe() + +From: Christophe JAILLET + +[ 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 +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + 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 a12cd0b5c9721..1d80bae86ec96 100644 +--- a/drivers/gpio/gpio-tb10x.c ++++ b/drivers/gpio/gpio-tb10x.c +@@ -246,7 +246,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; +@@ -260,6 +260,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-4.19/i2c-mux-demux-pinctrl-check-the-return-value-of-devm.patch b/queue-4.19/i2c-mux-demux-pinctrl-check-the-return-value-of-devm.patch new file mode 100644 index 00000000000..7fd88836f65 --- /dev/null +++ b/queue-4.19/i2c-mux-demux-pinctrl-check-the-return-value-of-devm.patch @@ -0,0 +1,38 @@ +From d5657a7c60aa39febf6f3d95c87fac3bb046ec7d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 3 Mar 2022 20:39:14 +0800 +Subject: i2c: mux: demux-pinctrl: check the return value of devm_kstrdup() + +From: Xiaoke Wang + +[ 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 +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + 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 1b99d0b928a0d..092ebc08549ff 100644 +--- a/drivers/i2c/muxes/i2c-demux-pinctrl.c ++++ b/drivers/i2c/muxes/i2c-demux-pinctrl.c +@@ -244,6 +244,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 + diff --git a/queue-4.19/series b/queue-4.19/series index fa47b019cc8..f87bd80c5f7 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -10,3 +10,5 @@ net-hns3-add-5ms-delay-before-clear-firmware-reset-i.patch net-add-atomic_long_t-to-net_device_stats-fields.patch net-bridge-use-dev_stats_inc.patch team-fix-null-ptr-deref-when-team-device-type-is-cha.patch +gpio-tb10x-fix-an-error-handling-path-in-tb10x_gpio_.patch +i2c-mux-demux-pinctrl-check-the-return-value-of-devm.patch