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: f4056e705b ("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>
This commit is contained in:
Frank Rowand 2020-03-25 20:45:30 -05:00 committed by Rob Herring
parent 978e9c3ba0
commit fb227f597d

View File

@ -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;
}