[PATCH 2/8] fb: return original fb_info in FBIOGET_SCREENINFO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/video/fb.c      | 4 +++-
 lib/gui/graphic_utils.c | 6 ++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index 29b4c71..dbda8d4 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -11,10 +11,12 @@
 static int fb_ioctl(struct cdev* cdev, int req, void *data)
 {
 	struct fb_info *info = cdev->priv;
+	struct fb_info **fb;
 
 	switch (req) {
 	case FBIOGET_SCREENINFO:
-		memcpy(data, info, sizeof(*info));
+		fb = data;
+		*fb = info;
 		break;
 	case FBIO_ENABLE:
 		info->fbops->fb_enable(info);
diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c
index 47003a0..f928ee1 100644
--- a/lib/gui/graphic_utils.c
+++ b/lib/gui/graphic_utils.c
@@ -281,7 +281,7 @@ struct screen *fb_open(const char * fbdev, bool offscreen)
 
 	info = xzalloc(sizeof(*info));
 
-	ret = ioctl(fd, FBIOGET_SCREENINFO, info);
+	ret = ioctl(fd, FBIOGET_SCREENINFO, &info);
 	if (ret) {
 		goto failed_screeninfo;
 	}
@@ -310,10 +310,8 @@ void fb_close(struct screen *sc)
 {
 	free(sc->offscreenbuf);
 
-	if (sc->fd > 0) {
+	if (sc->fd > 0)
 		close(sc->fd);
-		free(sc->info);
-	}
 
 	free(sc);
 }
-- 
2.4.6


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



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux