summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-10-19 12:12:31 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-10-19 12:12:37 +0200
commit020d19ddc5beb6385220e4492f856e6db3fb6187 (patch)
tree0e83e39750f01dd7113cd777c7ae58794130b3cf /lib
parent6d25da9e51d954cb6435cf4b505f161614c8d02e (diff)
downloadbarebox-020d19ddc5beb6385220e4492f856e6db3fb6187.tar.gz
barebox-020d19ddc5beb6385220e4492f856e6db3fb6187.tar.xz
graphic_utils: Fix freeing uninitialzed pointer in fb_open()
In fb_open() when fb_create_screen() fails then sc contains an error pointer which is then freed in the failure path. Fix this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/gui/graphic_utils.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c
index 7d238e9ff9..0bed932213 100644
--- a/lib/gui/graphic_utils.c
+++ b/lib/gui/graphic_utils.c
@@ -285,15 +285,13 @@ struct screen *fb_open(const char * fbdev)
sc = fb_create_screen(info);
if (IS_ERR(sc)) {
ret = PTR_ERR(sc);
- goto failed_create;
+ goto failed_screeninfo;
}
sc->fd = fd;
return sc;
-failed_create:
- free(sc);
failed_screeninfo:
close(fd);