diff options
-rw-r--r-- | drivers/video/fbcvt.c | 3 | ||||
-rw-r--r-- | drivers/video/fbmon.c | 3 | ||||
-rw-r--r-- | drivers/video/fbsysfs.c | 5 | ||||
-rw-r--r-- | drivers/video/vgastate.c | 5 |
4 files changed, 8 insertions, 8 deletions
diff --git a/drivers/video/fbcvt.c b/drivers/video/fbcvt.c index 0b6af00d197e..ac90883dc3aa 100644 --- a/drivers/video/fbcvt.c +++ b/drivers/video/fbcvt.c | |||
@@ -214,12 +214,11 @@ static void fb_cvt_print_name(struct fb_cvt_data *cvt) | |||
214 | { | 214 | { |
215 | u32 pixcount, pixcount_mod; | 215 | u32 pixcount, pixcount_mod; |
216 | int cnt = 255, offset = 0, read = 0; | 216 | int cnt = 255, offset = 0, read = 0; |
217 | u8 *buf = kmalloc(256, GFP_KERNEL); | 217 | u8 *buf = kzalloc(256, GFP_KERNEL); |
218 | 218 | ||
219 | if (!buf) | 219 | if (!buf) |
220 | return; | 220 | return; |
221 | 221 | ||
222 | memset(buf, 0, 256); | ||
223 | pixcount = (cvt->xres * (cvt->yres/cvt->interlace))/1000000; | 222 | pixcount = (cvt->xres * (cvt->yres/cvt->interlace))/1000000; |
224 | pixcount_mod = (cvt->xres * (cvt->yres/cvt->interlace)) % 1000000; | 223 | pixcount_mod = (cvt->xres * (cvt->yres/cvt->interlace)) % 1000000; |
225 | pixcount_mod /= 1000; | 224 | pixcount_mod /= 1000; |
diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c index 0ef75a9f84af..7c74e7325d95 100644 --- a/drivers/video/fbmon.c +++ b/drivers/video/fbmon.c | |||
@@ -528,10 +528,9 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize) | |||
528 | unsigned char *block; | 528 | unsigned char *block; |
529 | int num = 0, i; | 529 | int num = 0, i; |
530 | 530 | ||
531 | mode = kmalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL); | 531 | mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL); |
532 | if (mode == NULL) | 532 | if (mode == NULL) |
533 | return NULL; | 533 | return NULL; |
534 | memset(mode, 0, 50 * sizeof(struct fb_videomode)); | ||
535 | 534 | ||
536 | if (edid == NULL || !edid_checksum(edid) || | 535 | if (edid == NULL || !edid_checksum(edid) || |
537 | !edid_check_header(edid)) { | 536 | !edid_check_header(edid)) { |
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c index 35147030a3e8..6d26057337e2 100644 --- a/drivers/video/fbsysfs.c +++ b/drivers/video/fbsysfs.c | |||
@@ -43,10 +43,11 @@ struct fb_info *framebuffer_alloc(size_t size, struct device *dev) | |||
43 | if (size) | 43 | if (size) |
44 | fb_info_size += PADDING; | 44 | fb_info_size += PADDING; |
45 | 45 | ||
46 | p = kmalloc(fb_info_size + size, GFP_KERNEL); | 46 | p = kzalloc(fb_info_size + size, GFP_KERNEL); |
47 | |||
47 | if (!p) | 48 | if (!p) |
48 | return NULL; | 49 | return NULL; |
49 | memset(p, 0, fb_info_size + size); | 50 | |
50 | info = (struct fb_info *) p; | 51 | info = (struct fb_info *) p; |
51 | 52 | ||
52 | if (size) | 53 | if (size) |
diff --git a/drivers/video/vgastate.c b/drivers/video/vgastate.c index d9e01daee630..15179ec62339 100644 --- a/drivers/video/vgastate.c +++ b/drivers/video/vgastate.c | |||
@@ -356,10 +356,11 @@ int save_vga(struct vgastate *state) | |||
356 | { | 356 | { |
357 | struct regstate *saved; | 357 | struct regstate *saved; |
358 | 358 | ||
359 | saved = kmalloc(sizeof(struct regstate), GFP_KERNEL); | 359 | saved = kzalloc(sizeof(struct regstate), GFP_KERNEL); |
360 | |||
360 | if (saved == NULL) | 361 | if (saved == NULL) |
361 | return 1; | 362 | return 1; |
362 | memset (saved, 0, sizeof(struct regstate)); | 363 | |
363 | state->vidstate = (void *)saved; | 364 | state->vidstate = (void *)saved; |
364 | 365 | ||
365 | if (state->flags & VGA_SAVE_CMAP) { | 366 | if (state->flags & VGA_SAVE_CMAP) { |