drm/exynos/fb: free exynos framebuffer on error
authorAndrzej Hajda <a.hajda@samsung.com>
Tue, 9 Sep 2014 13:16:08 +0000 (15:16 +0200)
committerInki Dae <daeinki@gmail.com>
Fri, 19 Sep 2014 15:56:14 +0000 (00:56 +0900)
In case drm_framebuffer_init fails exynos_fb should be freed
before returning an error.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_fb.c

index 65a22cad7b36300811abf39b3a0d13020a479cc0..d346d1e6eda03775e63d6ad7f969a1e1a9f4431d 100644 (file)
@@ -165,6 +165,7 @@ exynos_drm_framebuffer_init(struct drm_device *dev,
 
        ret = drm_framebuffer_init(dev, &exynos_fb->fb, &exynos_drm_fb_funcs);
        if (ret) {
+               kfree(exynos_fb);
                DRM_ERROR("failed to initialize framebuffer\n");
                return ERR_PTR(ret);
        }