Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu amdgpu: Fix uninit...



details:   https://anonhg.NetBSD.org/src/rev/794ea7818fa5
branches:  trunk
changeset: 1028773:794ea7818fa5
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:59:45 2021 +0000

description:
amdgpu: Fix uninitialized variables.

If df_v3_6_pmc_config_2_cntr(adev, config) < 0 or >= 4, these don't
get set.

diffstat:

 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_df_v3_6.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r f8af9d816cff -r 794ea7818fa5 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_df_v3_6.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_df_v3_6.c        Sun Dec 19 11:59:30 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_df_v3_6.c        Sun Dec 19 11:59:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_df_v3_6.c,v 1.3 2021/12/19 11:35:07 riastradh Exp $     */
+/*     $NetBSD: amdgpu_df_v3_6.c,v 1.4 2021/12/19 11:59:45 riastradh Exp $     */
 
 /*
  * Copyright 2018 Advanced Micro Devices, Inc.
@@ -23,7 +23,7 @@
  *
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_df_v3_6.c,v 1.3 2021/12/19 11:35:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_df_v3_6.c,v 1.4 2021/12/19 11:59:45 riastradh Exp $");
 
 #include "amdgpu.h"
 #include "df_v3_6.h"
@@ -579,7 +579,7 @@
 static void df_v3_6_reset_perfmon_cntr(struct amdgpu_device *adev,
                                         uint64_t config)
 {
-       uint32_t lo_base_addr, hi_base_addr;
+       uint32_t lo_base_addr = 0, hi_base_addr = 0;
 
        df_v3_6_pmc_get_read_settings(adev, config, &lo_base_addr,
                                      &hi_base_addr);
@@ -665,7 +665,7 @@
                                  uint64_t config,
                                  uint64_t *count)
 {
-       uint32_t lo_base_addr, hi_base_addr, lo_val = 0, hi_val = 0;
+       uint32_t lo_base_addr = 0, hi_base_addr = 0, lo_val = 0, hi_val = 0;
        *count = 0;
 
        switch (adev->asic_type) {



Home | Main Index | Thread Index | Old Index