summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Rowand <frank.rowand@sony.com>2020-03-25 20:45:30 -0500
committerRob Herring <robh@kernel.org>2020-03-31 15:57:39 -0600
commitfb227f597d612c6660888d1947e68a25fed7b9cc (patch)
treed30d72b2f628f09bd3c6b80f790051d9c79595a8
parent978e9c3ba0aa2213d0f9ec421f704f867b9ed142 (diff)
downloadlinux-fb227f597d612c6660888d1947e68a25fed7b9cc.tar.gz
linux-fb227f597d612c6660888d1947e68a25fed7b9cc.tar.bz2
linux-fb227f597d612c6660888d1947e68a25fed7b9cc.zip
of: gpio unittest kfree() wrong object
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>
-rw-r--r--drivers/of/unittest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 1e5a2e4d893e..167c8f7a3151 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -1571,7 +1571,7 @@ static int unittest_gpio_remove(struct platform_device *pdev)
gpiochip_remove(&gdev->chip);
platform_set_drvdata(pdev, NULL);
- kfree(pdev);
+ kfree(gdev);
return 0;
}