Replace kzalloc by devm_kzalloc and remove the kfree() calls. Cc: Jean-Christophe Plagniol-Villard <plagnioj@xxxxxxxxxxxx> Cc: Tomi Valkeinen <tomi.valkeinen@xxxxxx> Cc: Eric Bénard <eric@xxxxxxxxxx> Cc: linux-fbdev@xxxxxxxxxxxxxxx Signed-off-by: Denis Carikli <denis@xxxxxxxxxx> --- ChangeLog v5->v6: - New patch needed by "video: mx3fb: Add device tree suport." --- drivers/video/mx3fb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c index 142e860..ee95de8 100644 --- a/drivers/video/mx3fb.c +++ b/drivers/video/mx3fb.c @@ -1496,7 +1496,7 @@ static int mx3fb_probe(struct platform_device *pdev) if (!sdc_reg) return -EINVAL; - mx3fb = kzalloc(sizeof(*mx3fb), GFP_KERNEL); + mx3fb = devm_kzalloc(&pdev->dev, sizeof(*mx3fb), GFP_KERNEL); if (!mx3fb) return -ENOMEM; @@ -1542,7 +1542,6 @@ ersdc0: dmaengine_put(); iounmap(mx3fb->reg_base); eremap: - kfree(mx3fb); dev_err(dev, "mx3fb: failed to register fb\n"); return ret; } @@ -1561,7 +1560,6 @@ static int mx3fb_remove(struct platform_device *dev) dmaengine_put(); iounmap(mx3fb->reg_base); - kfree(mx3fb); return 0; } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html