diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 1e5a2e4d893e4..167c8f7a3151d 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; }