From: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
To: airlied@linux.ie, dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH RESEND] drm/ast: free correct pointer in astfb_create() error paths
Date: Tue, 20 Sep 2016 11:56:49 +1000 [thread overview]
Message-ID: <20160920015649.31509-1-andrew.donnellan@au1.ibm.com> (raw)
In-Reply-To: <20160919071346.580-1-andrew.donnellan@au1.ibm.com>
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
next prev parent reply other threads:[~2016-09-20 1:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-19 7:13 [PATCH] drm/ast: free correct pointer in astfb_create() error paths Andrew Donnellan
2016-09-20 1:56 ` Andrew Donnellan [this message]
2016-09-20 2:54 ` [PATCH RESEND] " Andrew Donnellan
-- strict thread matches above, loose matches on Subject: below --
2016-11-14 3:03 Andrew Donnellan
2016-11-14 6:46 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160920015649.31509-1-andrew.donnellan@au1.ibm.com \
--to=andrew.donnellan@au1.ibm.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).