All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: fix dereferencing possible ERR_PTR()
@ 2018-03-15 10:33 Shirish S
       [not found] ` <1521110031-11510-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Shirish S @ 2018-03-15 10:33 UTC (permalink / raw)
  To: Alexander.Deucher-5C7GfCeVMHo, harry.wentland-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Shirish S

This patch fixes static checker warning caused by
"36cc549d5986: "drm/amd/display: disable CRTCs with
NULL FB on their primary plane (V2)"

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Shirish S <shirish.s@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 0564676..9e2cdc9 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4893,6 +4893,9 @@ static int dm_atomic_check_plane_state_fb(struct drm_atomic_state *state,
 			return -EDEADLK;
 
 		crtc_state = drm_atomic_get_crtc_state(plane_state->state, crtc);
+		if (IS_ERR(crtc_state))
+			return PTR_ERR(crtc_state);
+
 		if (crtc->primary == plane && crtc_state->active) {
 			if (!plane_state->fb)
 				return -EINVAL;
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/display: fix dereferencing possible ERR_PTR()
       [not found] ` <1521110031-11510-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-15 13:28   ` Deucher, Alexander
  2018-03-15 19:52   ` Harry Wentland
  1 sibling, 0 replies; 3+ messages in thread
From: Deucher, Alexander @ 2018-03-15 13:28 UTC (permalink / raw)
  To: S, Shirish, Wentland, Harry, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 1521 bytes --]

Acked-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>

________________________________
From: S, Shirish
Sent: Thursday, March 15, 2018 6:33:51 AM
To: Deucher, Alexander; Wentland, Harry; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: S, Shirish
Subject: [PATCH] drm/amd/display: fix dereferencing possible ERR_PTR()

This patch fixes static checker warning caused by
"36cc549d5986: "drm/amd/display: disable CRTCs with
NULL FB on their primary plane (V2)"

Reported-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Shirish S <shirish.s-5C7GfCeVMHo@public.gmane.org>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 0564676..9e2cdc9 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4893,6 +4893,9 @@ static int dm_atomic_check_plane_state_fb(struct drm_atomic_state *state,
                         return -EDEADLK;

                 crtc_state = drm_atomic_get_crtc_state(plane_state->state, crtc);
+               if (IS_ERR(crtc_state))
+                       return PTR_ERR(crtc_state);
+
                 if (crtc->primary == plane && crtc_state->active) {
                         if (!plane_state->fb)
                                 return -EINVAL;
--
2.7.4


[-- Attachment #1.2: Type: text/html, Size: 3233 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/display: fix dereferencing possible ERR_PTR()
       [not found] ` <1521110031-11510-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
  2018-03-15 13:28   ` Deucher, Alexander
@ 2018-03-15 19:52   ` Harry Wentland
  1 sibling, 0 replies; 3+ messages in thread
From: Harry Wentland @ 2018-03-15 19:52 UTC (permalink / raw)
  To: Shirish S, Alexander.Deucher-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2018-03-15 06:33 AM, Shirish S wrote:
> This patch fixes static checker warning caused by
> "36cc549d5986: "drm/amd/display: disable CRTCs with
> NULL FB on their primary plane (V2)"
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Shirish S <shirish.s@amd.com>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 0564676..9e2cdc9 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -4893,6 +4893,9 @@ static int dm_atomic_check_plane_state_fb(struct drm_atomic_state *state,
>  			return -EDEADLK;
>  
>  		crtc_state = drm_atomic_get_crtc_state(plane_state->state, crtc);
> +		if (IS_ERR(crtc_state))
> +			return PTR_ERR(crtc_state);
> +
>  		if (crtc->primary == plane && crtc_state->active) {
>  			if (!plane_state->fb)
>  				return -EINVAL;
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2018-03-15 19:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-15 10:33 [PATCH] drm/amd/display: fix dereferencing possible ERR_PTR() Shirish S
     [not found] ` <1521110031-11510-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org>
2018-03-15 13:28   ` Deucher, Alexander
2018-03-15 19:52   ` Harry Wentland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.