linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau/pmu: don't print reply values if exec is false
@ 2018-12-19 15:29 Colin King
  2019-01-24 17:28 ` Colin Ian King
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-12-19 15:29 UTC (permalink / raw)
  To: Ben Skeggs, David Airlie, Daniel Vetter, dri-devel, nouveau
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently the uninitialized values in the array reply are printed out
when exec is false and nvkm_pmu_send has not updated the array. Avoid
confusion by only dumping out these values if they have been actually
updated.

Detected by CoverityScan, CID#1271291 ("Uninitialized scaler variable")
Fixes: ebb58dc2ef8c ("drm/nouveau/pmu: rename from pwr (no binary change)")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c
index 11b28b086a06..7b052879af72 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c
@@ -88,10 +88,10 @@ nvkm_memx_fini(struct nvkm_memx **pmemx, bool exec)
 	if (exec) {
 		nvkm_pmu_send(pmu, reply, PROC_MEMX, MEMX_MSG_EXEC,
 			      memx->base, finish);
+		nvkm_debug(subdev, "Exec took %uns, PMU_IN %08x\n",
+			   reply[0], reply[1]);
 	}
 
-	nvkm_debug(subdev, "Exec took %uns, PMU_IN %08x\n",
-		   reply[0], reply[1]);
 	kfree(memx);
 	return 0;
 }
-- 
2.19.1


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

* Re: [PATCH] drm/nouveau/pmu: don't print reply values if exec is false
  2018-12-19 15:29 [PATCH] drm/nouveau/pmu: don't print reply values if exec is false Colin King
@ 2019-01-24 17:28 ` Colin Ian King
  0 siblings, 0 replies; 2+ messages in thread
From: Colin Ian King @ 2019-01-24 17:28 UTC (permalink / raw)
  To: Ben Skeggs, David Airlie, Daniel Vetter, dri-devel, nouveau
  Cc: kernel-janitors, linux-kernel

ping?

On 19/12/2018 15:29, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the uninitialized values in the array reply are printed out
> when exec is false and nvkm_pmu_send has not updated the array. Avoid
> confusion by only dumping out these values if they have been actually
> updated.
> 
> Detected by CoverityScan, CID#1271291 ("Uninitialized scaler variable")
> Fixes: ebb58dc2ef8c ("drm/nouveau/pmu: rename from pwr (no binary change)")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c
> index 11b28b086a06..7b052879af72 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c
> @@ -88,10 +88,10 @@ nvkm_memx_fini(struct nvkm_memx **pmemx, bool exec)
>  	if (exec) {
>  		nvkm_pmu_send(pmu, reply, PROC_MEMX, MEMX_MSG_EXEC,
>  			      memx->base, finish);
> +		nvkm_debug(subdev, "Exec took %uns, PMU_IN %08x\n",
> +			   reply[0], reply[1]);
>  	}
>  
> -	nvkm_debug(subdev, "Exec took %uns, PMU_IN %08x\n",
> -		   reply[0], reply[1]);
>  	kfree(memx);
>  	return 0;
>  }
> 


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

end of thread, other threads:[~2019-01-24 17:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-19 15:29 [PATCH] drm/nouveau/pmu: don't print reply values if exec is false Colin King
2019-01-24 17:28 ` Colin Ian King

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).