diff options
author | Frank Rowand <frank.rowand@sony.com> | 2020-03-26 04:45:30 +0300 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2020-04-01 00:57:39 +0300 |
commit | fb227f597d612c6660888d1947e68a25fed7b9cc (patch) | |
tree | d30d72b2f628f09bd3c6b80f790051d9c79595a8 /drivers/of | |
parent | 978e9c3ba0aa2213d0f9ec421f704f867b9ed142 (diff) | |
download | linux-fb227f597d612c6660888d1947e68a25fed7b9cc.tar.xz |
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>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/unittest.c | 2 |
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; } |