[Intel-gfx] [PATCH 4/4] drm/i915: Properly terminate KMS mode name string during tv init

David Weinehall david.weinehall at linux.intel.com
Fri Jan 29 06:00:52 PST 2016


On Fri, Jan 29, 2016 at 02:52:29PM +0200, Imre Deak wrote:
> Caught by Coverity.
> 
> Signed-off-by: Imre Deak <imre.deak at intel.com>

Reviewed-by: David Weinehall <david.weinehall at intel.com>

> ---
>  drivers/gpu/drm/i915/intel_tv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
> index 948cbff..5034b00 100644
> --- a/drivers/gpu/drm/i915/intel_tv.c
> +++ b/drivers/gpu/drm/i915/intel_tv.c
> @@ -1420,6 +1420,7 @@ intel_tv_get_modes(struct drm_connector *connector)
>  		if (!mode_ptr)
>  			continue;
>  		strncpy(mode_ptr->name, input->name, DRM_DISPLAY_MODE_LEN);
> +		mode_ptr->name[DRM_DISPLAY_MODE_LEN - 1] = '\0';
>  
>  		mode_ptr->hdisplay = hactive_s;
>  		mode_ptr->hsync_start = hactive_s + 1;
> -- 
> 2.5.0
> 


More information about the Intel-gfx mailing list