diff mbox series

nouveau/gsp/r535: uninitialized variable in r535_gsp_acpi_mux_id()

Message ID 1d864f6e-43e9-43d8-9d90-30e76c9c843b@moroto.mountain (mailing list archive)
State New, archived
Headers show
Series nouveau/gsp/r535: uninitialized variable in r535_gsp_acpi_mux_id() | expand

Commit Message

Dan Carpenter Nov. 7, 2023, 3:18 p.m. UTC
The if we hit the "continue" statement on the first iteration through
the loop then "handle_mux" needs to be set to NULL so we continue
looping.

Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Danilo Krummrich Nov. 7, 2023, 4:35 p.m. UTC | #1
On 11/7/23 16:18, Dan Carpenter wrote:
> The if we hit the "continue" statement on the first iteration through
> the loop then "handle_mux" needs to be set to NULL so we continue
> looping.
> 
> Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Good catch!

Reviewed-by: Danilo Krummrich <dakr@redhat.com>

@Dave: Can't pick this patch up myself, since this should probably go into
drm/topic/nvidia-gsp.

> ---
>   drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> index e31f9641114b..afa8e7377a76 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> @@ -1159,7 +1159,7 @@ static void
>   r535_gsp_acpi_mux_id(acpi_handle handle, u32 id, MUX_METHOD_DATA_ELEMENT *mode,
>   						 MUX_METHOD_DATA_ELEMENT *part)
>   {
> -	acpi_handle iter = NULL, handle_mux;
> +	acpi_handle iter = NULL, handle_mux = NULL;
>   	acpi_status status;
>   	unsigned long long value;
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
index e31f9641114b..afa8e7377a76 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
@@ -1159,7 +1159,7 @@  static void
 r535_gsp_acpi_mux_id(acpi_handle handle, u32 id, MUX_METHOD_DATA_ELEMENT *mode,
 						 MUX_METHOD_DATA_ELEMENT *part)
 {
-	acpi_handle iter = NULL, handle_mux;
+	acpi_handle iter = NULL, handle_mux = NULL;
 	acpi_status status;
 	unsigned long long value;