Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1521004 > unrolled thread

[PATCH RESEND] drm/ast: free correct pointer in astfb_create() error paths

Started byAndrew Donnellan <andrew.donnellan@au1.ibm.com>
First post2016-11-14 04:10 +0100
Last post2016-11-14 07:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH RESEND] drm/ast: free correct pointer in astfb_create() error paths Andrew Donnellan <andrew.donnellan@au1.ibm.com> - 2016-11-14 04:10 +0100
    Re: [PATCH RESEND] drm/ast: free correct pointer in astfb_create()  error paths Daniel Vetter <daniel@ffwll.ch> - 2016-11-14 07:50 +0100

#1521004 — [PATCH RESEND] drm/ast: free correct pointer in astfb_create() error paths

FromAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Date2016-11-14 04:10 +0100
Subject[PATCH RESEND] drm/ast: free correct pointer in astfb_create() error paths
Message-ID<sDfOG-11Z-23@gated-at.bofh.it>
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>

---

Found by Coverity Scan. Compile tested only.
---
 drivers/gpu/drm/ast/ast_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c
index 7a86e24..d6f5ec6 100644
--- a/drivers/gpu/drm/ast/ast_fb.c
+++ b/drivers/gpu/drm/ast/ast_fb.c
@@ -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;
 }
 
-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com  IBM Australia Limited

[toc] | [next] | [standalone]


#1521351 — Re: [PATCH RESEND] drm/ast: free correct pointer in astfb_create() error paths

FromDaniel Vetter <daniel@ffwll.ch>
Date2016-11-14 07:50 +0100
SubjectRe: [PATCH RESEND] drm/ast: free correct pointer in astfb_create() error paths
Message-ID<sDjfz-3nb-7@gated-at.bofh.it>
In reply to#1521004
On Mon, Nov 14, 2016 at 02:03:59PM +1100, Andrew Donnellan wrote:
> 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>

Applied to drm-misc, thanks.
-Daniel

> 
> ---
> 
> Found by Coverity Scan. Compile tested only.
> ---
>  drivers/gpu/drm/ast/ast_fb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c
> index 7a86e24..d6f5ec6 100644
> --- a/drivers/gpu/drm/ast/ast_fb.c
> +++ b/drivers/gpu/drm/ast/ast_fb.c
> @@ -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;
>  }
>  
> -- 
> Andrew Donnellan              OzLabs, ADL Canberra
> andrew.donnellan@au1.ibm.com  IBM Australia Limited
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web