[lkml]   [2020]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 1/2] of: gpio unittest kfree() wrong object
From: Frank Rowand <>

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

kfree() gdev instead of pdev.

Fixes: f4056e705b2e ("of: unittest: add overlay gpio test to catch gpio hog problem")
Reported-by: kernel test robot <>
Signed-off-by: Frank Rowand <>
drivers/of/unittest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 96ae8a762a9e..25911ad1ce99 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -122,7 +122,7 @@ static int unittest_gpio_remove(struct platform_device *pdev)

platform_set_drvdata(pdev, NULL);
- kfree(pdev);
+ kfree(gdev);

return 0;
Frank Rowand <>
 \ /
  Last update: 2020-03-26 02:47    [W:0.071 / U:28.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site