提交 4113819e 编写于 作者: K Krzysztof Helt 提交者: Linus Torvalds

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: NKrzysztof Helt <krzysztof.h1@wp.pl>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 100b4a6e
...@@ -378,7 +378,6 @@ static void __init offb_init_fb(const char *name, const char *full_name, ...@@ -378,7 +378,6 @@ static void __init offb_init_fb(const char *name, const char *full_name,
struct fb_fix_screeninfo *fix; struct fb_fix_screeninfo *fix;
struct fb_var_screeninfo *var; struct fb_var_screeninfo *var;
struct fb_info *info; struct fb_info *info;
int size;
if (!request_mem_region(res_start, res_size, "offb")) if (!request_mem_region(res_start, res_size, "offb"))
return; return;
...@@ -393,15 +392,12 @@ static void __init offb_init_fb(const char *name, const char *full_name, ...@@ -393,15 +392,12 @@ static void __init offb_init_fb(const char *name, const char *full_name,
return; return;
} }
size = sizeof(struct fb_info) + sizeof(u32) * 16; info = framebuffer_alloc(sizeof(u32) * 16, NULL);
info = kmalloc(size, GFP_ATOMIC);
if (info == 0) { if (info == 0) {
release_mem_region(res_start, res_size); release_mem_region(res_start, res_size);
return; return;
} }
memset(info, 0, size);
fix = &info->fix; fix = &info->fix;
var = &info->var; var = &info->var;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册