Re: [PATCH 21/29] video: rework mode_name parameter setting

Alexander Shiyan shc_work at mail.ru
Mon Apr 7 07:45:55 PDT 2014


Fri, 14 Mar 2014 15:32:41 +0100 от Sascha Hauer <s.hauer at pengutronix.de>:
> We have dev_add_param_enum() now, so use it for the mode_name
> setting. Also drop the special case for single mode framebuffers,
> just add the mode_name parameter for this case aswell.
> 
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
> ---
...
> +static int fb_setup_mode(struct fb_info *info)
> +{
> +	struct device_d *dev = &info->dev;
> +	int ret;
...
> -	ret = info->fbops->fb_activate_var(info);
> +	if (info->fbops->fb_activate_var) {
> +		ret = info->fbops->fb_activate_var(info);
> +		if (ret)
> +			return ret;
> +	}

So, "ret" is unitialized without fb_activate_var().
It is wrong since this variable is used in code below.

	if (!ret) {
		dev->resource[0].start = (resource_size_t)info->screen_base;
		info->cdev.size = info->line_length * info->yres;
		dev->resource[0].end = dev->resource[0].start + info->cdev.size - 1;
	} else
		info->cdev.size = 0;

---



More information about the barebox mailing list