Skip to content

Commit

Permalink
drm/exynos: Use devm_kzalloc in exynos_drm_vidi.c file
Browse files Browse the repository at this point in the history
devm_kzalloc is a device managed function and makes freeing and error
handling simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
  • Loading branch information
Sachin Kamat authored and Inki Dae committed Sep 13, 2012
1 parent 16e1974 commit 59848db
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/gpu/drm/exynos/exynos_drm_vidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ static int __devinit vidi_probe(struct platform_device *pdev)

DRM_DEBUG_KMS("%s\n", __FILE__);

ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;

Expand Down Expand Up @@ -673,8 +673,6 @@ static int __devexit vidi_remove(struct platform_device *pdev)
ctx->raw_edid = NULL;
}

kfree(ctx);

return 0;
}

Expand Down

0 comments on commit 59848db

Please sign in to comment.