Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54942
b: refs/heads/master
c: 38b4982
h: refs/heads/master
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed May 8, 2007
1 parent c5181cb commit 5a173df
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff388ad05bc67163124ac74126bbc16faa2fb771
refs/heads/master: 38b4982c6388ae9596f959e3d7fef91affbd181d
21 changes: 21 additions & 0 deletions trunk/drivers/video/console/fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,17 @@ static void set_blitting_type(struct vc_data *vc, struct fb_info *info)
fbcon_set_bitops(ops);
}
}

static int fbcon_invalid_charcount(struct fb_info *info, unsigned charcount)
{
int err = 0;

if (info->flags & FBINFO_MISC_TILEBLITTING &&
info->tileops->fb_get_tilemax(info) < charcount)
err = 1;

return err;
}
#else
static void set_blitting_type(struct vc_data *vc, struct fb_info *info)
{
Expand All @@ -695,6 +706,12 @@ static void set_blitting_type(struct vc_data *vc, struct fb_info *info)
fbcon_set_rotation(info);
fbcon_set_bitops(ops);
}

static int fbcon_invalid_charcount(struct fb_info *info, unsigned charcount)
{
return 0;
}

#endif /* CONFIG_MISC_TILEBLITTING */


Expand Down Expand Up @@ -2518,6 +2535,10 @@ static int fbcon_set_font(struct vc_data *vc, struct console_font *font, unsigne
!(info->pixmap.blit_y & (1 << (font->height - 1))))
return -EINVAL;

/* Make sure driver can handle the font length */
if (fbcon_invalid_charcount(info, charcount))
return -EINVAL;

size = h * pitch * charcount;

new_data = kmalloc(FONT_EXTRA_WORDS * sizeof(int) + size, GFP_USER);
Expand Down

0 comments on commit 5a173df

Please sign in to comment.