mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Bastian Stender <bst@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Bastian Stender <bst@pengutronix.de>
Subject: [PATCH 2/3] graphic_utils: do not allocate info in fb_open
Date: Thu, 23 Feb 2017 17:45:26 +0100	[thread overview]
Message-ID: <20170223164527.29878-2-bst@pengutronix.de> (raw)
In-Reply-To: <20170223164527.29878-1-bst@pengutronix.de>

info was errorneously allocated, but it really is a pointer to a fb_info
struct from the framebuffer. This fixes a memory leak.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
---
 lib/gui/graphic_utils.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c
index f6ab5ea0d1..7d238e9ff9 100644
--- a/lib/gui/graphic_utils.c
+++ b/lib/gui/graphic_utils.c
@@ -277,8 +277,6 @@ struct screen *fb_open(const char * fbdev)
 	if (fd < 0)
 		return ERR_PTR(fd);
 
-	info = xzalloc(sizeof(*info));
-
 	ret = ioctl(fd, FBIOGET_SCREENINFO, &info);
 	if (ret) {
 		goto failed_screeninfo;
@@ -291,7 +289,6 @@ struct screen *fb_open(const char * fbdev)
 	}
 
 	sc->fd = fd;
-	sc->info = info;
 
 	return sc;
 
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-02-23 16:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23 16:45 [PATCH 1/3] graphic_utils: implement 8 bpp color depth in gu_set_pixel Bastian Stender
2017-02-23 16:45 ` Bastian Stender [this message]
2017-02-23 16:45 ` [PATCH 3/3] 2d-primitives: check dimensions in __illuminate Bastian Stender
2017-02-24  7:24 ` [PATCH 1/3] graphic_utils: implement 8 bpp color depth in gu_set_pixel Sascha Hauer

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=20170223164527.29878-2-bst@pengutronix.de \
    --to=bst@pengutronix.de \
    --cc=barebox@lists.infradead.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