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


Groups > linux.kernel > #1486191 > unrolled thread

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

Started byAndrew Donnellan <andrew.donnellan@au1.ibm.com>
First post2016-09-19 09:20 +0200
Last post2016-09-20 05:00 +0200
Articles 3 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] drm/ast: free correct pointer in astfb_create() error paths Andrew Donnellan <andrew.donnellan@au1.ibm.com> - 2016-09-19 09:20 +0200
    [PATCH RESEND] drm/ast: free correct pointer in astfb_create() error paths Andrew Donnellan <andrew.donnellan@au1.ibm.com> - 2016-09-20 04:00 +0200
      Re: [PATCH RESEND] drm/ast: free correct pointer in astfb_create()  error paths Andrew Donnellan <andrew.donnellan@au1.ibm.com> - 2016-09-20 05:00 +0200

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

FromAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Date2016-09-19 09:20 +0200
Subject[PATCH] drm/ast: free correct pointer in astfb_create() error paths
Message-ID<sj11T-2o5-7@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 c017a93..0fef8ea 100644
--- a/drivers/gpu/drm/ast/ast_fb.c
+++ b/drivers/gpu/drm/ast/ast_fb.c
@@ -254,7 +254,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]


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

FromAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Date2016-09-20 04:00 +0200
Subject[PATCH RESEND] drm/ast: free correct pointer in astfb_create() error paths
Message-ID<sjivL-4Vq-7@gated-at.bofh.it>
In reply to#1486191
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.

Resending as it looks like this didn't hit dri-devel.
---
 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 c017a93..0fef8ea 100644
--- a/drivers/gpu/drm/ast/ast_fb.c
+++ b/drivers/gpu/drm/ast/ast_fb.c
@@ -254,7 +254,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] | [prev] | [next] | [standalone]


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

FromAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Date2016-09-20 05:00 +0200
SubjectRe: [PATCH RESEND] drm/ast: free correct pointer in astfb_create() error paths
Message-ID<sjjrP-5Ci-9@gated-at.bofh.it>
In reply to#1487008
On 20/09/16 11:56, 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>
>
> ---
>
> Found by Coverity Scan. Compile tested only.
>
> Resending as it looks like this didn't hit dri-devel.

It did show up after all :)

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com  IBM Australia Limited

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web