]> git.karo-electronics.de Git - linux-beck.git/commitdiff
fbdev: remove unnecessary memset in vfb
authorMarcin Chojnacki <marcinch7@gmail.com>
Thu, 18 Jun 2015 13:01:52 +0000 (15:01 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 20 Aug 2015 09:03:53 +0000 (12:03 +0300)
In vfb_probe memory is allocated using rvmalloc which automatically
sets the allocated memory to zero. This patch removes the second
unnecessary memset in vfb_probe.

Signed-off-by: Marcin Chojnacki <marcinch7@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/vfb.c

index 70a897b1e4588cb42bd21206de9a0ae3df55ae72..b9c2f81fb6b9f047bfcd2e144140cce80c3731c0 100644 (file)
@@ -51,7 +51,14 @@ static void *rvmalloc(unsigned long size)
        if (!mem)
                return NULL;
 
-       memset(mem, 0, size); /* Clear the ram out, no junk to the user */
+       /*
+        * VFB must clear memory to prevent kernel info
+        * leakage into userspace
+        * VGA-based drivers MUST NOT clear memory if
+        * they want to be able to take over vgacon
+        */
+
+       memset(mem, 0, size);
        adr = (unsigned long) mem;
        while (size > 0) {
                SetPageReserved(vmalloc_to_page((void *)adr));
@@ -490,14 +497,6 @@ static int vfb_probe(struct platform_device *dev)
        if (!(videomemory = rvmalloc(videomemorysize)))
                return retval;
 
-       /*
-        * VFB must clear memory to prevent kernel info
-        * leakage into userspace
-        * VGA-based drivers MUST NOT clear memory if
-        * they want to be able to take over vgacon
-        */
-       memset(videomemory, 0, videomemorysize);
-
        info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev);
        if (!info)
                goto err;