fbdev: remove unnecessary memset in vfb
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>
This commit is contained in:
parent
48fd8ecf29
commit
c0a3229313
@ -51,7 +51,14 @@ static void *rvmalloc(unsigned long size)
|
|||||||
if (!mem)
|
if (!mem)
|
||||||
return NULL;
|
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;
|
adr = (unsigned long) mem;
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
SetPageReserved(vmalloc_to_page((void *)adr));
|
SetPageReserved(vmalloc_to_page((void *)adr));
|
||||||
@ -490,14 +497,6 @@ static int vfb_probe(struct platform_device *dev)
|
|||||||
if (!(videomemory = rvmalloc(videomemorysize)))
|
if (!(videomemory = rvmalloc(videomemorysize)))
|
||||||
return retval;
|
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);
|
info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev);
|
||||||
if (!info)
|
if (!info)
|
||||||
goto err;
|
goto err;
|
||||||
|
Loading…
Reference in New Issue
Block a user