Skip to content

Commit

Permalink
of: gpio unittest kfree() wrong object
Browse files Browse the repository at this point in the history
commit fb227f5 upstream.

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 <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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Frank Rowand authored and Greg Kroah-Hartman committed Feb 23, 2024
1 parent 6ac8965 commit e9aa8e5
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 @@ -124,7 +124,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 e9aa8e5

Please sign in to comment.