Skip to content

Commit

Permalink
of: gpio unittest kfree() wrong object
Browse files Browse the repository at this point in the history
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: f4056e7 ("of: unittest: add overlay gpio test to catch gpio hog problem")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Frank Rowand <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
  • Loading branch information
frowand authored and robherring committed Mar 31, 2020
1 parent 978e9c3 commit fb227f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/of/unittest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fb227f5

Please sign in to comment.