Re: [PATCH] drm: add check for plane functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 17, 2017 at 01:25:08PM +0530, Shirish S wrote:
> update_plane() and disable_plane() functions
> assoiciated with setting plane are called
> without any check, causing kernel panic.

Why are you registering a plane without the funcs?

> 
> This patch adds the required check to avoid it.
> 
> Change-Id: I0d6792608b33e674c217388aa57c4b7d680d9bc7
> Signed-off-by: Shirish S <shirish.s@xxxxxxx>
> ---
>  drivers/gpu/drm/drm_plane.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> index 249c0ae..f675f8b 100644
> --- a/drivers/gpu/drm/drm_plane.c
> +++ b/drivers/gpu/drm/drm_plane.c
> @@ -456,6 +456,12 @@ static int __setplane_internal(struct drm_plane *plane,
>  {
>  	int ret = 0;
>  
> +	if (plane->funcs->disable_plane == NULL ||
> +				plane->funcs->update_plane == NULL) {
> +		DRM_ERROR("plane funcs not implemented\n");
> +		ret = -EPERM;
> +		goto out;
> +	}
>  	/* No fb means shut it down */
>  	if (!fb) {
>  		plane->old_fb = plane->fb;
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux