char *option = NULL;
if (fb_get_options(connector->name, &option))
- return;
+ goto out_err;
if (!drm_mode_parse_command_line_for_connector(option,
connector,
mode))
- return;
+ goto out_err;
if (mode->force) {
const char *s;
mode->rb ? " reduced blanking" : "",
mode->margins ? " with margins" : "",
mode->interlace ? " interlaced" : "");
+ out_err:
+ if(option != NULL)
+ kfree(option);
}
/**
goto fail4;
}
- strcpy(fbi->fix.id, "VIGS");
+ strncpy(fbi->fix.id, "VIGS", sizeof(fbi->fix.id));
drm_fb_helper_fill_fix(fbi, vigs_fb->base.pitches[0], vigs_fb->base.depth);
drm_fb_helper_fill_var(fbi, helper, vigs_fb->base.width, vigs_fb->base.height);
* TODO: Play around with xoffset/yoffset, make sure this code works.
*/
- offset = fbi->var.xoffset * (vigs_fb->base.bits_per_pixel >> 3);
+ offset = (unsigned long)(fbi->var.xoffset) * (vigs_fb->base.bits_per_pixel >> 3);
offset += fbi->var.yoffset * vigs_fb->base.pitches[0];
/*
goto fail1;
}
- sprintf(vma_cache_name, "vigs_vma_cache%u", vigs_vma_cache_index++);
+ snprintf(vma_cache_name, 100, "vigs_vma_cache%u", vigs_vma_cache_index++);
(*mman)->vma_cache = kmem_cache_create(vma_cache_name,
sizeof(struct vigs_mman_vma) +
preferred_mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
drm_mode_set_crtcinfo(preferred_mode, CRTC_INTERLACE_HALVE_V);
drm_mode_probed_add(connector, preferred_mode);
+ if (option != NULL)
+ kfree(option);
return 1;
}
}
opt[name_len] == ':')
options = opt + name_len + 1;
}
+ options = kstrdup(options, GFP_KERNEL);
}
/* No match, pass global option */
if (!options && option && fb_mode_option)