linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/rcar-du: Fix error check when retrieving crtc state
@ 2019-06-17 18:15 Sean Paul
  2019-06-18  7:26 ` Laurent Pinchart
  0 siblings, 1 reply; 3+ messages in thread
From: Sean Paul @ 2019-06-17 18:15 UTC (permalink / raw)
  To: dri-devel
  Cc: Sean Paul, Daniel Vetter, Ville Syrjälä,
	Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Ben Skeggs,
	Laurent Pinchart, Kieran Bingham, Eric Anholt, Maarten Lankhorst,
	Maxime Ripard, Sean Paul, David Airlie, Lyude Paul, Karol Herbst,
	Ilia Mirkin, intel-gfx, linux-renesas-soc, kbuild test robot,
	Dan Carpenter

From: Sean Paul <seanpaul@chromium.org>

drm_atomic_get_crtc_state() returns an error pointer when it fails, so
the null check is doing nothing here.

Credit to 0-day/Dan Carpenter for reporting this.

Fixes: 6f3b62781bbd ("drm: Convert connector_helper_funcs->atomic_check to accept drm_atomic_state")
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [for rcar lvds]
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Karol Herbst <karolherbst@gmail.com>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/rcar-du/rcar_lvds.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
index f2a5d4d997073..1c62578590f46 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
@@ -115,8 +115,8 @@ static int rcar_lvds_connector_atomic_check(struct drm_connector *connector,
 
 	/* We're not allowed to modify the resolution. */
 	crtc_state = drm_atomic_get_crtc_state(state, conn_state->crtc);
-	if (!crtc_state)
-		return -EINVAL;
+	if (IS_ERR(crtc_state))
+		return PTR_ERR(crtc_state);
 
 	if (crtc_state->mode.hdisplay != panel_mode->hdisplay ||
 	    crtc_state->mode.vdisplay != panel_mode->vdisplay)
-- 
Sean Paul, Software Engineer, Google / Chromium OS


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/rcar-du: Fix error check when retrieving crtc state
  2019-06-17 18:15 [PATCH] drm/rcar-du: Fix error check when retrieving crtc state Sean Paul
@ 2019-06-18  7:26 ` Laurent Pinchart
  2019-06-18 16:47   ` Sean Paul
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Pinchart @ 2019-06-18  7:26 UTC (permalink / raw)
  To: Sean Paul
  Cc: dri-devel, Sean Paul, Daniel Vetter, Ville Syrjälä,
	Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Ben Skeggs,
	Kieran Bingham, Eric Anholt, Maarten Lankhorst, Maxime Ripard,
	David Airlie, Lyude Paul, Karol Herbst, Ilia Mirkin, intel-gfx,
	linux-renesas-soc, kbuild test robot, Dan Carpenter

Hi Sean,

Thank you for the patch.

On Mon, Jun 17, 2019 at 02:15:42PM -0400, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
> 
> drm_atomic_get_crtc_state() returns an error pointer when it fails, so
> the null check is doing nothing here.
> 
> Credit to 0-day/Dan Carpenter for reporting this.
> 
> Fixes: 6f3b62781bbd ("drm: Convert connector_helper_funcs->atomic_check to accept drm_atomic_state")
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [for rcar lvds]
> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Cc: Sean Paul <sean@poorly.run>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Lyude Paul <lyude@redhat.com>
> Cc: Karol Herbst <karolherbst@gmail.com>
> Cc: Ilia Mirkin <imirkin@alum.mit.edu>
> Cc: dri-devel@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: linux-renesas-soc@vger.kernel.org
> Reported-by: kbuild test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I have no pending conflicting changes for rcar_lvds.c. Do you plan to
merge this through drm-misc ?

> ---
>  drivers/gpu/drm/rcar-du/rcar_lvds.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> index f2a5d4d997073..1c62578590f46 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> @@ -115,8 +115,8 @@ static int rcar_lvds_connector_atomic_check(struct drm_connector *connector,
>  
>  	/* We're not allowed to modify the resolution. */
>  	crtc_state = drm_atomic_get_crtc_state(state, conn_state->crtc);
> -	if (!crtc_state)
> -		return -EINVAL;
> +	if (IS_ERR(crtc_state))
> +		return PTR_ERR(crtc_state);
>  
>  	if (crtc_state->mode.hdisplay != panel_mode->hdisplay ||
>  	    crtc_state->mode.vdisplay != panel_mode->vdisplay)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/rcar-du: Fix error check when retrieving crtc state
  2019-06-18  7:26 ` Laurent Pinchart
@ 2019-06-18 16:47   ` Sean Paul
  0 siblings, 0 replies; 3+ messages in thread
From: Sean Paul @ 2019-06-18 16:47 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Sean Paul, dri-devel, Sean Paul, Daniel Vetter,
	Ville Syrjälä,
	Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Ben Skeggs,
	Kieran Bingham, Eric Anholt, Maarten Lankhorst, Maxime Ripard,
	David Airlie, Lyude Paul, Karol Herbst, Ilia Mirkin, intel-gfx,
	linux-renesas-soc, kbuild test robot, Dan Carpenter

On Tue, Jun 18, 2019 at 10:26:52AM +0300, Laurent Pinchart wrote:
> Hi Sean,
> 
> Thank you for the patch.
> 
> On Mon, Jun 17, 2019 at 02:15:42PM -0400, Sean Paul wrote:
> > From: Sean Paul <seanpaul@chromium.org>
> > 
> > drm_atomic_get_crtc_state() returns an error pointer when it fails, so
> > the null check is doing nothing here.
> > 
> > Credit to 0-day/Dan Carpenter for reporting this.
> > 
> > Fixes: 6f3b62781bbd ("drm: Convert connector_helper_funcs->atomic_check to accept drm_atomic_state")
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Ben Skeggs <bskeggs@redhat.com>
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> > Cc: Eric Anholt <eric@anholt.net>
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [for rcar lvds]
> > Cc: Sean Paul <seanpaul@chromium.org>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> > Cc: Sean Paul <sean@poorly.run>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: Lyude Paul <lyude@redhat.com>
> > Cc: Karol Herbst <karolherbst@gmail.com>
> > Cc: Ilia Mirkin <imirkin@alum.mit.edu>
> > Cc: dri-devel@lists.freedesktop.org
> > Cc: intel-gfx@lists.freedesktop.org
> > Cc: linux-renesas-soc@vger.kernel.org
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> > Signed-off-by: Sean Paul <seanpaul@chromium.org>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> I have no pending conflicting changes for rcar_lvds.c. Do you plan to
> merge this through drm-misc ?

Thanks for your review!

Yeah, since the bug is only in drm-misc-next, this will also go there. Speaking
of which, I just applied it :-)

Sean

> 
> > ---
> >  drivers/gpu/drm/rcar-du/rcar_lvds.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> > index f2a5d4d997073..1c62578590f46 100644
> > --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
> > +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> > @@ -115,8 +115,8 @@ static int rcar_lvds_connector_atomic_check(struct drm_connector *connector,
> >  
> >  	/* We're not allowed to modify the resolution. */
> >  	crtc_state = drm_atomic_get_crtc_state(state, conn_state->crtc);
> > -	if (!crtc_state)
> > -		return -EINVAL;
> > +	if (IS_ERR(crtc_state))
> > +		return PTR_ERR(crtc_state);
> >  
> >  	if (crtc_state->mode.hdisplay != panel_mode->hdisplay ||
> >  	    crtc_state->mode.vdisplay != panel_mode->vdisplay)
> 
> -- 
> Regards,
> 
> Laurent Pinchart

-- 
Sean Paul, Software Engineer, Google / Chromium OS

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-18 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17 18:15 [PATCH] drm/rcar-du: Fix error check when retrieving crtc state Sean Paul
2019-06-18  7:26 ` Laurent Pinchart
2019-06-18 16:47   ` Sean Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).