mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 15:54:15 +08:00
drivers/char/consolemap.c: kmalloc + memset conversion to kzalloc
drivers/char/consolemap.c | 22678 -> 22650 (-28 bytes) drivers/char/consolemap.o | 90113 -> 90029 (-84 bytes) Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
0b15d04af3
commit
392b7bc13e
@ -494,12 +494,11 @@ int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui)
|
||||
p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc;
|
||||
if (p && p->readonly) return -EIO;
|
||||
if (!p || --p->refcount) {
|
||||
q = kmalloc(sizeof(*p), GFP_KERNEL);
|
||||
q = kzalloc(sizeof(*p), GFP_KERNEL);
|
||||
if (!q) {
|
||||
if (p) p->refcount++;
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(q, 0, sizeof(*q));
|
||||
q->refcount=1;
|
||||
*vc->vc_uni_pagedir_loc = (unsigned long)q;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user