diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-02-21 13:34:50 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-02-21 13:34:50 +0100 |
commit | 78dae18cef8b08648e864a757aca6dbae30ee5e0 (patch) | |
tree | ed8dc7bebc26d8a6b27fca34daf96c1067c57b9d /queue-5.4 | |
parent | 893c5eaefd936831e0bf0b1b5f9e9ccc6497ceab (diff) | |
download | stable-queue-78dae18cef8b08648e864a757aca6dbae30ee5e0.tar.gz |
5.4-stable patches
added patches:
of-gpio-unittest-kfree-wrong-object.patch
of-unittest-fix-expect-text-for-gpio-hog-errors.patch
Diffstat (limited to 'queue-5.4')
-rw-r--r-- | queue-5.4/of-gpio-unittest-kfree-wrong-object.patch | 38 | ||||
-rw-r--r-- | queue-5.4/of-unittest-fix-expect-text-for-gpio-hog-errors.patch | 83 | ||||
-rw-r--r-- | queue-5.4/series | 2 |
3 files changed, 123 insertions, 0 deletions
diff --git a/queue-5.4/of-gpio-unittest-kfree-wrong-object.patch b/queue-5.4/of-gpio-unittest-kfree-wrong-object.patch new file mode 100644 index 0000000000..6959bb9f7a --- /dev/null +++ b/queue-5.4/of-gpio-unittest-kfree-wrong-object.patch @@ -0,0 +1,38 @@ +From fb227f597d612c6660888d1947e68a25fed7b9cc Mon Sep 17 00:00:00 2001 +From: Frank Rowand <frank.rowand@sony.com> +Date: Wed, 25 Mar 2020 20:45:30 -0500 +Subject: of: gpio unittest kfree() wrong object + +From: Frank Rowand <frank.rowand@sony.com> + +commit fb227f597d612c6660888d1947e68a25fed7b9cc upstream. + +kernel test robot reported "WARNING: held lock freed!" triggered by +unittest_gpio_remove(). unittest_gpio_remove() was unexpectedly +called due to an error in overlay tracking. The remove had not +been tested because the gpio overlay removal tests have not been +implemented. + +kfree() gdev instead of pdev. + +Fixes: f4056e705b2e ("of: unittest: add overlay gpio test to catch gpio hog problem") +Reported-by: kernel test robot <lkp@intel.com> +Signed-off-by: Frank Rowand <frank.rowand@sony.com> +Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> +Signed-off-by: Rob Herring <robh@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/of/unittest.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/of/unittest.c ++++ b/drivers/of/unittest.c +@@ -124,7 +124,7 @@ static int unittest_gpio_remove(struct p + gpiochip_remove(&gdev->chip); + + platform_set_drvdata(pdev, NULL); +- kfree(pdev); ++ kfree(gdev); + + return 0; + } diff --git a/queue-5.4/of-unittest-fix-expect-text-for-gpio-hog-errors.patch b/queue-5.4/of-unittest-fix-expect-text-for-gpio-hog-errors.patch new file mode 100644 index 0000000000..5835fdcad0 --- /dev/null +++ b/queue-5.4/of-unittest-fix-expect-text-for-gpio-hog-errors.patch @@ -0,0 +1,83 @@ +From e85860e5bc077865a04f0a88d0b0335d3200484a Mon Sep 17 00:00:00 2001 +From: Frank Rowand <frank.rowand@sony.com> +Date: Thu, 28 Oct 2021 20:32:25 -0500 +Subject: of: unittest: fix EXPECT text for gpio hog errors + +From: Frank Rowand <frank.rowand@sony.com> + +commit e85860e5bc077865a04f0a88d0b0335d3200484a upstream. + +The console message text for gpio hog errors does not match +what unittest expects. + +Fixes: f4056e705b2ef ("of: unittest: add overlay gpio test to catch gpio hog problem") +Signed-off-by: Frank Rowand <frank.rowand@sony.com> +Link: https://lore.kernel.org/r/20211029013225.2048695-1-frowand.list@gmail.com +Signed-off-by: Rob Herring <robh@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/of/unittest.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- a/drivers/of/unittest.c ++++ b/drivers/of/unittest.c +@@ -2258,19 +2258,19 @@ static void __init of_unittest_overlay_g + */ + + EXPECT_BEGIN(KERN_INFO, +- "GPIO line <<int>> (line-B-input) hogged as input\n"); ++ "gpio-<<int>> (line-B-input): hogged as input\n"); + + EXPECT_BEGIN(KERN_INFO, +- "GPIO line <<int>> (line-A-input) hogged as input\n"); ++ "gpio-<<int>> (line-A-input): hogged as input\n"); + + ret = platform_driver_register(&unittest_gpio_driver); + if (unittest(ret == 0, "could not register unittest gpio driver\n")) + return; + + EXPECT_END(KERN_INFO, +- "GPIO line <<int>> (line-A-input) hogged as input\n"); ++ "gpio-<<int>> (line-A-input): hogged as input\n"); + EXPECT_END(KERN_INFO, +- "GPIO line <<int>> (line-B-input) hogged as input\n"); ++ "gpio-<<int>> (line-B-input): hogged as input\n"); + + unittest(probe_pass_count + 2 == unittest_gpio_probe_pass_count, + "unittest_gpio_probe() failed or not called\n"); +@@ -2297,7 +2297,7 @@ static void __init of_unittest_overlay_g + chip_request_count = unittest_gpio_chip_request_count; + + EXPECT_BEGIN(KERN_INFO, +- "GPIO line <<int>> (line-D-input) hogged as input\n"); ++ "gpio-<<int>> (line-D-input): hogged as input\n"); + + /* overlay_gpio_03 contains gpio node and child gpio hog node */ + +@@ -2305,7 +2305,7 @@ static void __init of_unittest_overlay_g + "Adding overlay 'overlay_gpio_03' failed\n"); + + EXPECT_END(KERN_INFO, +- "GPIO line <<int>> (line-D-input) hogged as input\n"); ++ "gpio-<<int>> (line-D-input): hogged as input\n"); + + unittest(probe_pass_count + 1 == unittest_gpio_probe_pass_count, + "unittest_gpio_probe() failed or not called\n"); +@@ -2344,7 +2344,7 @@ static void __init of_unittest_overlay_g + */ + + EXPECT_BEGIN(KERN_INFO, +- "GPIO line <<int>> (line-C-input) hogged as input\n"); ++ "gpio-<<int>> (line-C-input): hogged as input\n"); + + /* overlay_gpio_04b contains child gpio hog node */ + +@@ -2352,7 +2352,7 @@ static void __init of_unittest_overlay_g + "Adding overlay 'overlay_gpio_04b' failed\n"); + + EXPECT_END(KERN_INFO, +- "GPIO line <<int>> (line-C-input) hogged as input\n"); ++ "gpio-<<int>> (line-C-input): hogged as input\n"); + + unittest(chip_request_count + 1 == unittest_gpio_chip_request_count, + "unittest_gpio_chip_request() called %d times (expected 1 time)\n", diff --git a/queue-5.4/series b/queue-5.4/series index ae76b84627..eeb8611252 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -263,3 +263,5 @@ lsm-new-security_file_ioctl_compat-hook.patch netfilter-nf_tables-fix-pointer-math-issue-in-nft_byteorder_eval.patch revert-revert-mtd-rawnand-gpmi-fix-setting-busy-timeout-setting.patch net-bcmgenet-fix-eee-implementation.patch +of-unittest-fix-expect-text-for-gpio-hog-errors.patch +of-gpio-unittest-kfree-wrong-object.patch |