diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 3443bedb0e0b..f1aa09215d4b 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -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; }