[Intel-gfx] [PATCH 1/4] drm/fb-helper: Do not assume drm_mode_create_from_cmdline_mode() can't fail

Daniel Vetter daniel at ffwll.ch
Fri Jun 7 18:21:21 UTC 2019


On Fri, Jun 07, 2019 at 07:26:08PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> drm_mode_create_from_cmdline_mode() can return NULL, so the caller
> should check for that.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

Aside I noticed that we can drop a few EXPORT_SYMBOL here, I'll type a
patch.
-Daniel
> ---
>  drivers/gpu/drm/drm_fb_helper.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index b9b7c06cbc4f..bdfa14cd7f6d 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -2205,7 +2205,9 @@ struct drm_display_mode *drm_pick_cmdline_mode(struct drm_fb_helper_connector *f
>  create_mode:
>  	mode = drm_mode_create_from_cmdline_mode(fb_helper_conn->connector->dev,
>  						 cmdline_mode);
> -	list_add(&mode->head, &fb_helper_conn->connector->modes);
> +	if (mode)
> +		list_add(&mode->head, &fb_helper_conn->connector->modes);
> +
>  	return mode;
>  }
>  EXPORT_SYMBOL(drm_pick_cmdline_mode);
> -- 
> 2.21.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list