Showing error 1616

User: Jiri Slaby
Error type: Division by Zero
Error type description: The code tries to divide by zero
File location: drivers/video/i810/i810_main.c
Line in file: 1006
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by 16b71fdf97599f1b1b7f38418ee9922d9f117396
Tools: Manual Work
Entered: 2012-08-14 09:42:06 UTC


Source:

 976        var->blue.msb_right = 0;
 977        var->transp.msb_right = 0;
 978}
 979
 980/**
 981 * i810_check_params - check if contents in var are valid
 982 * @var: pointer to fb_var_screeninfo
 983 * @info: pointer to fb_info
 984 *
 985 * DESCRIPTION:
 986 * This will check if the framebuffer size is sufficient 
 987 * for the current mode and if the user's monitor has the 
 988 * required specifications to display the current mode.
 989 */
 990static int i810_check_params(struct fb_var_screeninfo *var, 
 991                             struct fb_info *info)
 992{
 993        struct i810fb_par *par = info->par;
 994        int line_length, vidmem, mode_valid = 0, retval = 0;
 995        u32 vyres = var->yres_virtual, vxres = var->xres_virtual;
 996        /*
 997         *  Memory limit
 998         */
 999        line_length = get_line_length(par, vxres, var->bits_per_pixel);
1000        vidmem = line_length*vyres;
1001
1002        if (vidmem > par->fb.size) {
1003                vyres = par->fb.size/line_length;
1004                if (vyres < var->yres) {
1005                        vyres = yres;
1006                        vxres = par->fb.size/vyres;
1007                        vxres /= var->bits_per_pixel >> 3;
1008                        line_length = get_line_length(par, vxres, 
1009                                                      var->bits_per_pixel);
1010                        vidmem = line_length * yres;
1011                        if (vxres < var->xres) {
1012                                printk("i810fb: required video memory, "
1013                                       "%d bytes, for %dx%d-%d (virtual) "
1014                                       "is out of range\n", 
1015                                       vidmem, vxres, vyres, 
1016                                       var->bits_per_pixel);
Show full sources