mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-02 13:06:40 +07:00
offb: use framebuffer_alloc() to allocate fb_info struct
Use the framebuffer_alloc() function to allocate the fb_info structure so the structure is correctly initialized after allocation. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
100b4a6eef
commit
4113819eb3
@ -378,7 +378,6 @@ static void __init offb_init_fb(const char *name, const char *full_name,
|
||||
struct fb_fix_screeninfo *fix;
|
||||
struct fb_var_screeninfo *var;
|
||||
struct fb_info *info;
|
||||
int size;
|
||||
|
||||
if (!request_mem_region(res_start, res_size, "offb"))
|
||||
return;
|
||||
@ -393,15 +392,12 @@ static void __init offb_init_fb(const char *name, const char *full_name,
|
||||
return;
|
||||
}
|
||||
|
||||
size = sizeof(struct fb_info) + sizeof(u32) * 16;
|
||||
|
||||
info = kmalloc(size, GFP_ATOMIC);
|
||||
info = framebuffer_alloc(sizeof(u32) * 16, NULL);
|
||||
|
||||
if (info == 0) {
|
||||
release_mem_region(res_start, res_size);
|
||||
return;
|
||||
}
|
||||
memset(info, 0, size);
|
||||
|
||||
fix = &info->fix;
|
||||
var = &info->var;
|
||||
|
Loading…
Reference in New Issue
Block a user