All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
@ 2020-03-08  9:26 ` Christophe JAILLET
  0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2020-03-08  9:26 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	David1.Zhou, airlied, daniel, nicholas.kazlauskas,
	Bhawanpreet.Lakha, mario.kleiner.de, David.Francis
  Cc: amd-gfx, dri-devel, linux-kernel, kernel-janitors, Christophe JAILLET

'dc_stream_release()' may be called twice. Once here, and once below in the
error handling path if we branch to the 'fail' label.

Set 'new_stream' to NULL, once released to avoid the duplicated release
function call.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Maybe the 'goto fail' at line 7745 should be turned into a 'return ret'
instead. Could be clearer.

No Fixes tag provided because I've not been able to dig deep enough in the
git history.
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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 97c1b01c0fc1..9d7773a77c4f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7704,8 +7704,10 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
 
 skip_modeset:
 	/* Release extra reference */
-	if (new_stream)
-		 dc_stream_release(new_stream);
+	if (new_stream) {
+		dc_stream_release(new_stream);
+		new_stream = NULL;
+	}
 
 	/*
 	 * We want to do dc stream updates that do not require a
-- 
2.20.1


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

* [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
@ 2020-03-08  9:26 ` Christophe JAILLET
  0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2020-03-08  9:26 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	David1.Zhou, airlied, daniel, nicholas.kazlauskas,
	Bhawanpreet.Lakha, mario.kleiner.de, David.Francis
  Cc: Christophe JAILLET, kernel-janitors, dri-devel, amd-gfx, linux-kernel

'dc_stream_release()' may be called twice. Once here, and once below in the
error handling path if we branch to the 'fail' label.

Set 'new_stream' to NULL, once released to avoid the duplicated release
function call.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Maybe the 'goto fail' at line 7745 should be turned into a 'return ret'
instead. Could be clearer.

No Fixes tag provided because I've not been able to dig deep enough in the
git history.
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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 97c1b01c0fc1..9d7773a77c4f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7704,8 +7704,10 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
 
 skip_modeset:
 	/* Release extra reference */
-	if (new_stream)
-		 dc_stream_release(new_stream);
+	if (new_stream) {
+		dc_stream_release(new_stream);
+		new_stream = NULL;
+	}
 
 	/*
 	 * We want to do dc stream updates that do not require a
-- 
2.20.1

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

* [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
@ 2020-03-08  9:26 ` Christophe JAILLET
  0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2020-03-08  9:26 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	David1.Zhou, airlied, daniel, nicholas.kazlauskas,
	Bhawanpreet.Lakha, mario.kleiner.de, David.Francis
  Cc: Christophe JAILLET, kernel-janitors, dri-devel, amd-gfx, linux-kernel

'dc_stream_release()' may be called twice. Once here, and once below in the
error handling path if we branch to the 'fail' label.

Set 'new_stream' to NULL, once released to avoid the duplicated release
function call.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Maybe the 'goto fail' at line 7745 should be turned into a 'return ret'
instead. Could be clearer.

No Fixes tag provided because I've not been able to dig deep enough in the
git history.
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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 97c1b01c0fc1..9d7773a77c4f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7704,8 +7704,10 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
 
 skip_modeset:
 	/* Release extra reference */
-	if (new_stream)
-		 dc_stream_release(new_stream);
+	if (new_stream) {
+		dc_stream_release(new_stream);
+		new_stream = NULL;
+	}
 
 	/*
 	 * We want to do dc stream updates that do not require a
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
@ 2020-03-08  9:26 ` Christophe JAILLET
  0 siblings, 0 replies; 12+ messages in thread
From: Christophe JAILLET @ 2020-03-08  9:26 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	David1.Zhou, airlied, daniel, nicholas.kazlauskas,
	Bhawanpreet.Lakha, mario.kleiner.de, David.Francis
  Cc: Christophe JAILLET, kernel-janitors, dri-devel, amd-gfx, linux-kernel

'dc_stream_release()' may be called twice. Once here, and once below in the
error handling path if we branch to the 'fail' label.

Set 'new_stream' to NULL, once released to avoid the duplicated release
function call.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Maybe the 'goto fail' at line 7745 should be turned into a 'return ret'
instead. Could be clearer.

No Fixes tag provided because I've not been able to dig deep enough in the
git history.
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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 97c1b01c0fc1..9d7773a77c4f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7704,8 +7704,10 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
 
 skip_modeset:
 	/* Release extra reference */
-	if (new_stream)
-		 dc_stream_release(new_stream);
+	if (new_stream) {
+		dc_stream_release(new_stream);
+		new_stream = NULL;
+	}
 
 	/*
 	 * We want to do dc stream updates that do not require a
-- 
2.20.1

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

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

* AW: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
  2020-03-08  9:26 ` Christophe JAILLET
  (?)
  (?)
@ 2020-03-09  8:24   ` Walter Harms
  -1 siblings, 0 replies; 12+ messages in thread
From: Walter Harms @ 2020-03-09  8:24 UTC (permalink / raw)
  To: Christophe JAILLET, harry.wentland, sunpeng.li,
	alexander.deucher, christian.koenig, David1.Zhou, airlied,
	daniel, nicholas.kazlauskas, Bhawanpreet.Lakha, mario.kleiner.de,
	David.Francis
  Cc: amd-gfx, dri-devel, linux-kernel, kernel-janitors


________________________________________
Von: kernel-janitors-owner@vger.kernel.org <kernel-janitors-owner@vger.kernel.org> im Auftrag von Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Gesendet: Sonntag, 8. März 2020 10:26
An: harry.wentland@amd.com; sunpeng.li@amd.com; alexander.deucher@amd.com; christian.koenig@amd.com; David1.Zhou@amd.com; airlied@linux.ie; daniel@ffwll.ch; nicholas.kazlauskas@amd.com; Bhawanpreet.Lakha@amd.com; mario.kleiner.de@gmail.com; David.Francis@amd.com
Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org; Christophe JAILLET
Betreff: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'

'dc_stream_release()' may be called twice. Once here, and once below in the
error handling path if we branch to the 'fail' label.

Set 'new_stream' to NULL, once released to avoid the duplicated release
function call.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Maybe the 'goto fail' at line 7745 should be turned into a 'return ret'
instead. Could be clearer.

No Fixes tag provided because I've not been able to dig deep enough in the
git history.
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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 97c1b01c0fc1..9d7773a77c4f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7704,8 +7704,10 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,

 skip_modeset:
        /* Release extra reference */
-       if (new_stream)
-                dc_stream_release(new_stream);
+       if (new_stream) {
+               dc_stream_release(new_stream);
+               new_stream = NULL;
+       }


dc_stream_release() is NULL-checked, so the if can be dropped.

re,
 wh

        /*
         * We want to do dc stream updates that do not require a
--
2.20.1


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

* AW: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
@ 2020-03-09  8:24   ` Walter Harms
  0 siblings, 0 replies; 12+ messages in thread
From: Walter Harms @ 2020-03-09  8:24 UTC (permalink / raw)
  To: Christophe JAILLET, harry.wentland, sunpeng.li,
	alexander.deucher, christian.koenig, David1.Zhou, airlied,
	daniel, nicholas.kazlauskas, Bhawanpreet.Lakha, mario.kleiner.de,
	David.Francis
  Cc: kernel-janitors, dri-devel, amd-gfx, linux-kernel


________________________________________
Von: kernel-janitors-owner@vger.kernel.org <kernel-janitors-owner@vger.kernel.org> im Auftrag von Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Gesendet: Sonntag, 8. März 2020 10:26
An: harry.wentland@amd.com; sunpeng.li@amd.com; alexander.deucher@amd.com; christian.koenig@amd.com; David1.Zhou@amd.com; airlied@linux.ie; daniel@ffwll.ch; nicholas.kazlauskas@amd.com; Bhawanpreet.Lakha@amd.com; mario.kleiner.de@gmail.com; David.Francis@amd.com
Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org; Christophe JAILLET
Betreff: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'

'dc_stream_release()' may be called twice. Once here, and once below in the
error handling path if we branch to the 'fail' label.

Set 'new_stream' to NULL, once released to avoid the duplicated release
function call.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Maybe the 'goto fail' at line 7745 should be turned into a 'return ret'
instead. Could be clearer.

No Fixes tag provided because I've not been able to dig deep enough in the
git history.
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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 97c1b01c0fc1..9d7773a77c4f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7704,8 +7704,10 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,

 skip_modeset:
        /* Release extra reference */
-       if (new_stream)
-                dc_stream_release(new_stream);
+       if (new_stream) {
+               dc_stream_release(new_stream);
+               new_stream = NULL;
+       }


dc_stream_release() is NULL-checked, so the if can be dropped.

re,
 wh

        /*
         * We want to do dc stream updates that do not require a
--
2.20.1

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

* AW: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
@ 2020-03-09  8:24   ` Walter Harms
  0 siblings, 0 replies; 12+ messages in thread
From: Walter Harms @ 2020-03-09  8:24 UTC (permalink / raw)
  To: Christophe JAILLET, harry.wentland, sunpeng.li,
	alexander.deucher, christian.koenig, David1.Zhou, airlied,
	daniel, nicholas.kazlauskas, Bhawanpreet.Lakha, mario.kleiner.de,
	David.Francis
  Cc: kernel-janitors, dri-devel, amd-gfx, linux-kernel


________________________________________
Von: kernel-janitors-owner@vger.kernel.org <kernel-janitors-owner@vger.kernel.org> im Auftrag von Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Gesendet: Sonntag, 8. März 2020 10:26
An: harry.wentland@amd.com; sunpeng.li@amd.com; alexander.deucher@amd.com; christian.koenig@amd.com; David1.Zhou@amd.com; airlied@linux.ie; daniel@ffwll.ch; nicholas.kazlauskas@amd.com; Bhawanpreet.Lakha@amd.com; mario.kleiner.de@gmail.com; David.Francis@amd.com
Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org; Christophe JAILLET
Betreff: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'

'dc_stream_release()' may be called twice. Once here, and once below in the
error handling path if we branch to the 'fail' label.

Set 'new_stream' to NULL, once released to avoid the duplicated release
function call.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Maybe the 'goto fail' at line 7745 should be turned into a 'return ret'
instead. Could be clearer.

No Fixes tag provided because I've not been able to dig deep enough in the
git history.
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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 97c1b01c0fc1..9d7773a77c4f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7704,8 +7704,10 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,

 skip_modeset:
        /* Release extra reference */
-       if (new_stream)
-                dc_stream_release(new_stream);
+       if (new_stream) {
+               dc_stream_release(new_stream);
+               new_stream = NULL;
+       }


dc_stream_release() is NULL-checked, so the if can be dropped.

re,
 wh

        /*
         * We want to do dc stream updates that do not require a
--
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* AW: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
@ 2020-03-09  8:24   ` Walter Harms
  0 siblings, 0 replies; 12+ messages in thread
From: Walter Harms @ 2020-03-09  8:24 UTC (permalink / raw)
  To: Christophe JAILLET, harry.wentland, sunpeng.li,
	alexander.deucher, christian.koenig, David1.Zhou, airlied,
	daniel, nicholas.kazlauskas, Bhawanpreet.Lakha, mario.kleiner.de,
	David.Francis
  Cc: kernel-janitors, dri-devel, amd-gfx, linux-kernel


________________________________________
Von: kernel-janitors-owner@vger.kernel.org <kernel-janitors-owner@vger.kernel.org> im Auftrag von Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Gesendet: Sonntag, 8. März 2020 10:26
An: harry.wentland@amd.com; sunpeng.li@amd.com; alexander.deucher@amd.com; christian.koenig@amd.com; David1.Zhou@amd.com; airlied@linux.ie; daniel@ffwll.ch; nicholas.kazlauskas@amd.com; Bhawanpreet.Lakha@amd.com; mario.kleiner.de@gmail.com; David.Francis@amd.com
Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org; Christophe JAILLET
Betreff: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'

'dc_stream_release()' may be called twice. Once here, and once below in the
error handling path if we branch to the 'fail' label.

Set 'new_stream' to NULL, once released to avoid the duplicated release
function call.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Maybe the 'goto fail' at line 7745 should be turned into a 'return ret'
instead. Could be clearer.

No Fixes tag provided because I've not been able to dig deep enough in the
git history.
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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 97c1b01c0fc1..9d7773a77c4f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7704,8 +7704,10 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,

 skip_modeset:
        /* Release extra reference */
-       if (new_stream)
-                dc_stream_release(new_stream);
+       if (new_stream) {
+               dc_stream_release(new_stream);
+               new_stream = NULL;
+       }


dc_stream_release() is NULL-checked, so the if can be dropped.

re,
 wh

        /*
         * We want to do dc stream updates that do not require a
--
2.20.1

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

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

* Re: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
  2020-03-09  8:24   ` Walter Harms
  (?)
  (?)
@ 2020-03-12 13:38     ` Dan Carpenter
  -1 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2020-03-12 13:38 UTC (permalink / raw)
  To: Walter Harms
  Cc: Christophe JAILLET, harry.wentland, sunpeng.li,
	alexander.deucher, christian.koenig, David1.Zhou, airlied,
	daniel, nicholas.kazlauskas, Bhawanpreet.Lakha, mario.kleiner.de,
	David.Francis, amd-gfx, dri-devel, linux-kernel, kernel-janitors

On Mon, Mar 09, 2020 at 08:24:04AM +0000, Walter Harms wrote:
> 
> ________________________________________
> Von: kernel-janitors-owner@vger.kernel.org <kernel-janitors-owner@vger.kernel.org> im Auftrag von Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Gesendet: Sonntag, 8. März 2020 10:26
> An: harry.wentland@amd.com; sunpeng.li@amd.com; alexander.deucher@amd.com; christian.koenig@amd.com; David1.Zhou@amd.com; airlied@linux.ie; daniel@ffwll.ch; nicholas.kazlauskas@amd.com; Bhawanpreet.Lakha@amd.com; mario.kleiner.de@gmail.com; David.Francis@amd.com
> Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org; Christophe JAILLET
> Betreff: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
> 
> 'dc_stream_release()' may be called twice. Once here, and once below in the
> error handling path if we branch to the 'fail' label.
> 
> Set 'new_stream' to NULL, once released to avoid the duplicated release
> function call.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Maybe the 'goto fail' at line 7745 should be turned into a 'return ret'
> instead. Could be clearer.
> 
> No Fixes tag provided because I've not been able to dig deep enough in the
> git history.
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> 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 97c1b01c0fc1..9d7773a77c4f 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -7704,8 +7704,10 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
> 
>  skip_modeset:
>         /* Release extra reference */
> -       if (new_stream)
> -                dc_stream_release(new_stream);
> +       if (new_stream) {
> +               dc_stream_release(new_stream);
> +               new_stream = NULL;
> +       }
> 
> 
> dc_stream_release() is NULL-checked, so the if can be dropped.
> 
> re,
>  wh

Walter, it's really hard to separate your reply from the quoted email.
What's going on with that?  Could you configure your email client to
use "> " for the quoted bit?

regards,
dan carpenter


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

* Re: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
@ 2020-03-12 13:38     ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2020-03-12 13:38 UTC (permalink / raw)
  To: Walter Harms
  Cc: David1.Zhou, mario.kleiner.de, sunpeng.li, Bhawanpreet.Lakha,
	David.Francis, kernel-janitors, linux-kernel, amd-gfx,
	nicholas.kazlauskas, airlied, Christophe JAILLET, dri-devel,
	daniel, alexander.deucher, harry.wentland, christian.koenig

On Mon, Mar 09, 2020 at 08:24:04AM +0000, Walter Harms wrote:
> 
> ________________________________________
> Von: kernel-janitors-owner@vger.kernel.org <kernel-janitors-owner@vger.kernel.org> im Auftrag von Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Gesendet: Sonntag, 8. März 2020 10:26
> An: harry.wentland@amd.com; sunpeng.li@amd.com; alexander.deucher@amd.com; christian.koenig@amd.com; David1.Zhou@amd.com; airlied@linux.ie; daniel@ffwll.ch; nicholas.kazlauskas@amd.com; Bhawanpreet.Lakha@amd.com; mario.kleiner.de@gmail.com; David.Francis@amd.com
> Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org; Christophe JAILLET
> Betreff: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
> 
> 'dc_stream_release()' may be called twice. Once here, and once below in the
> error handling path if we branch to the 'fail' label.
> 
> Set 'new_stream' to NULL, once released to avoid the duplicated release
> function call.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Maybe the 'goto fail' at line 7745 should be turned into a 'return ret'
> instead. Could be clearer.
> 
> No Fixes tag provided because I've not been able to dig deep enough in the
> git history.
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> 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 97c1b01c0fc1..9d7773a77c4f 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -7704,8 +7704,10 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
> 
>  skip_modeset:
>         /* Release extra reference */
> -       if (new_stream)
> -                dc_stream_release(new_stream);
> +       if (new_stream) {
> +               dc_stream_release(new_stream);
> +               new_stream = NULL;
> +       }
> 
> 
> dc_stream_release() is NULL-checked, so the if can be dropped.
> 
> re,
>  wh

Walter, it's really hard to separate your reply from the quoted email.
What's going on with that?  Could you configure your email client to
use "> " for the quoted bit?

regards,
dan carpenter

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

* Re: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
@ 2020-03-12 13:38     ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2020-03-12 13:38 UTC (permalink / raw)
  To: Walter Harms
  Cc: sunpeng.li, Bhawanpreet.Lakha, David.Francis, kernel-janitors,
	linux-kernel, amd-gfx, nicholas.kazlauskas, airlied,
	Christophe JAILLET, dri-devel, alexander.deucher,
	christian.koenig

On Mon, Mar 09, 2020 at 08:24:04AM +0000, Walter Harms wrote:
> 
> ________________________________________
> Von: kernel-janitors-owner@vger.kernel.org <kernel-janitors-owner@vger.kernel.org> im Auftrag von Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Gesendet: Sonntag, 8. März 2020 10:26
> An: harry.wentland@amd.com; sunpeng.li@amd.com; alexander.deucher@amd.com; christian.koenig@amd.com; David1.Zhou@amd.com; airlied@linux.ie; daniel@ffwll.ch; nicholas.kazlauskas@amd.com; Bhawanpreet.Lakha@amd.com; mario.kleiner.de@gmail.com; David.Francis@amd.com
> Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org; Christophe JAILLET
> Betreff: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
> 
> 'dc_stream_release()' may be called twice. Once here, and once below in the
> error handling path if we branch to the 'fail' label.
> 
> Set 'new_stream' to NULL, once released to avoid the duplicated release
> function call.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Maybe the 'goto fail' at line 7745 should be turned into a 'return ret'
> instead. Could be clearer.
> 
> No Fixes tag provided because I've not been able to dig deep enough in the
> git history.
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> 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 97c1b01c0fc1..9d7773a77c4f 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -7704,8 +7704,10 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
> 
>  skip_modeset:
>         /* Release extra reference */
> -       if (new_stream)
> -                dc_stream_release(new_stream);
> +       if (new_stream) {
> +               dc_stream_release(new_stream);
> +               new_stream = NULL;
> +       }
> 
> 
> dc_stream_release() is NULL-checked, so the if can be dropped.
> 
> re,
>  wh

Walter, it's really hard to separate your reply from the quoted email.
What's going on with that?  Could you configure your email client to
use "> " for the quoted bit?

regards,
dan carpenter

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
@ 2020-03-12 13:38     ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2020-03-12 13:38 UTC (permalink / raw)
  To: Walter Harms
  Cc: David1.Zhou, mario.kleiner.de, sunpeng.li, Bhawanpreet.Lakha,
	David.Francis, kernel-janitors, linux-kernel, amd-gfx,
	nicholas.kazlauskas, airlied, Christophe JAILLET, dri-devel,
	daniel, alexander.deucher, harry.wentland, christian.koenig

On Mon, Mar 09, 2020 at 08:24:04AM +0000, Walter Harms wrote:
> 
> ________________________________________
> Von: kernel-janitors-owner@vger.kernel.org <kernel-janitors-owner@vger.kernel.org> im Auftrag von Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Gesendet: Sonntag, 8. März 2020 10:26
> An: harry.wentland@amd.com; sunpeng.li@amd.com; alexander.deucher@amd.com; christian.koenig@amd.com; David1.Zhou@amd.com; airlied@linux.ie; daniel@ffwll.ch; nicholas.kazlauskas@amd.com; Bhawanpreet.Lakha@amd.com; mario.kleiner.de@gmail.com; David.Francis@amd.com
> Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org; Christophe JAILLET
> Betreff: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'
> 
> 'dc_stream_release()' may be called twice. Once here, and once below in the
> error handling path if we branch to the 'fail' label.
> 
> Set 'new_stream' to NULL, once released to avoid the duplicated release
> function call.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Maybe the 'goto fail' at line 7745 should be turned into a 'return ret'
> instead. Could be clearer.
> 
> No Fixes tag provided because I've not been able to dig deep enough in the
> git history.
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> 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 97c1b01c0fc1..9d7773a77c4f 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -7704,8 +7704,10 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
> 
>  skip_modeset:
>         /* Release extra reference */
> -       if (new_stream)
> -                dc_stream_release(new_stream);
> +       if (new_stream) {
> +               dc_stream_release(new_stream);
> +               new_stream = NULL;
> +       }
> 
> 
> dc_stream_release() is NULL-checked, so the if can be dropped.
> 
> re,
>  wh

Walter, it's really hard to separate your reply from the quoted email.
What's going on with that?  Could you configure your email client to
use "> " for the quoted bit?

regards,
dan carpenter

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

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

end of thread, other threads:[~2020-03-12 13:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-08  9:26 [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()' Christophe JAILLET
2020-03-08  9:26 ` Christophe JAILLET
2020-03-08  9:26 ` Christophe JAILLET
2020-03-08  9:26 ` Christophe JAILLET
2020-03-09  8:24 ` AW: " Walter Harms
2020-03-09  8:24   ` Walter Harms
2020-03-09  8:24   ` Walter Harms
2020-03-09  8:24   ` Walter Harms
2020-03-12 13:38   ` Dan Carpenter
2020-03-12 13:38     ` Dan Carpenter
2020-03-12 13:38     ` Dan Carpenter
2020-03-12 13:38     ` Dan Carpenter

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.