X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fvideo%2Fvgastate.c;h=15179ec62339f4dd6a02897442ded8bf85d6ab3e;hb=99b3738fbf17208ac474420fa6b7e4b0c0c2b9ed;hp=ca92940f39438d9d7b4bffe0456815a2421b6b58;hpb=ad2c10f8f00d3fe2e37dd8a107e7cf4ac0459489;p=linux-2.6 diff --git a/drivers/video/vgastate.c b/drivers/video/vgastate.c index ca92940f39..15179ec623 100644 --- a/drivers/video/vgastate.c +++ b/drivers/video/vgastate.c @@ -356,10 +356,11 @@ int save_vga(struct vgastate *state) { struct regstate *saved; - saved = kmalloc(sizeof(struct regstate), GFP_KERNEL); + saved = kzalloc(sizeof(struct regstate), GFP_KERNEL); + if (saved == NULL) return 1; - memset (saved, 0, sizeof(struct regstate)); + state->vidstate = (void *)saved; if (state->flags & VGA_SAVE_CMAP) { @@ -485,11 +486,6 @@ int restore_vga (struct vgastate *state) return 0; } -#ifdef MODULE -int init_module(void) { return 0; }; -void cleanup_module(void) {}; -#endif - EXPORT_SYMBOL(save_vga); EXPORT_SYMBOL(restore_vga);