]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/ast: free correct pointer in astfb_create() error paths
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Mon, 14 Nov 2016 03:03:59 +0000 (14:03 +1100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 14 Nov 2016 06:45:16 +0000 (07:45 +0100)
In the err_free_vram and err_release_fbi error paths in astfb_create(), we
attempt to free afbdev->sysram. The only jumps to these error paths occur
before we assign afbdev->sysram = sysram. Free sysram instead.

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161114030359.27852-1-andrew.donnellan@au1.ibm.com
drivers/gpu/drm/ast/ast_fb.c

index 7a86e24e268750aa82e75f3f784594af5170485d..d6f5ec64c6673eb3424a11dd2d602d6e3822892f 100644 (file)
@@ -253,7 +253,7 @@ static int astfb_create(struct drm_fb_helper *helper,
 err_release_fbi:
        drm_fb_helper_release_fbi(helper);
 err_free_vram:
-       vfree(afbdev->sysram);
+       vfree(sysram);
        return ret;
 }