lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202009060624.Yoq9KfEs%lkp@intel.com>
Date:   Sun, 6 Sep 2020 06:18:32 +0800
From:   kernel test robot <lkp@...el.com>
To:     Andrey Grodzovsky <andrey.grodzovsky@....com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Alex Deucher <alexander.deucher@....com>,
        Luben Tuikov <luben.tuikov@....com>
Subject: drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:1855:42: warning:
 Uninitialized variable: fw_ver

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9322c47b21b9e05d7f9c037aa2c472e9f0dc7f3b
commit: 57430471e2fa60a412e220fa3014567e792aaa6f drm/amdgpu: Add support for USBC PD FW download
date:   6 months ago
compiler: hppa-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>


cppcheck warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:1855:42: warning: Uninitialized variable: fw_ver [uninitvar]
    return snprintf(buf, PAGE_SIZE, "%xn", fw_ver);
                                            ^
>> drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3769:9: warning: Identical condition 'r', second condition is always false [identicalConditionAfterEarlyExit]
    return r;
           ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3766:6: note: first condition
    if (r)
        ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3769:9: note: second condition
    return r;
           ^
>> drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3904:7: warning: Identical inner 'if' condition is always true. [identicalInnerCondition]
     if (grbm_soft_reset) {
         ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3894:6: note: outer condition: grbm_soft_reset
    if (grbm_soft_reset) {
        ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3904:7: note: identical inner condition: grbm_soft_reset
     if (grbm_soft_reset) {
         ^
>> drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:771:6: warning: Variable 'err' is reassigned a value before the old one has been used. [redundantAssignment]
    err = request_firmware(&adev->gfx.mec_fw, fw_name, adev->dev);
        ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:719:7: note: Variable 'err' is reassigned a value before the old one has been used.
     err = amdgpu_ucode_validate(adev->gfx.rlc_fw);
         ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:771:6: note: Variable 'err' is reassigned a value before the old one has been used.
    err = request_firmware(&adev->gfx.mec_fw, fw_name, adev->dev);
        ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:1271:7: warning: Variable 'ring' is reassigned a value before the old one has been used. [redundantAssignment]
    ring = &adev->gfx.compute_ring[ring_id];
         ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:1269:0: note: Variable 'ring' is reassigned a value before the old one has been used.
    struct amdgpu_ring *ring = &adev->gfx.compute_ring[ring_id];
   ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:1271:7: note: Variable 'ring' is reassigned a value before the old one has been used.
    ring = &adev->gfx.compute_ring[ring_id];
         ^
>> drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:2400:2: warning: Local variable i shadows outer variable [shadowVar]
    WREG32_SOC15_RLC(GC, 0, mmCP_ME_CNTL, tmp);
    ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:2390:6: note: Shadowed declaration
    int i;
        ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:2400:2: note: Shadow variable
    WREG32_SOC15_RLC(GC, 0, mmCP_ME_CNTL, tmp);
    ^
>> drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:2400:2: warning: Local variable tmp shadows outer variable [shadowVar]
    WREG32_SOC15_RLC(GC, 0, mmCP_ME_CNTL, tmp);
    ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:2391:6: note: Shadowed declaration
    u32 tmp = RREG32_SOC15(GC, 0, mmCP_ME_CNTL);
        ^
   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:2400:2: note: Shadow variable
    WREG32_SOC15_RLC(GC, 0, mmCP_ME_CNTL, tmp);
    ^
>> drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3797:6: warning: Unused variable: r [unusedVariable]
    int r;
        ^
>> drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:687:22: warning: Either the condition 'allowed_vdd_mclk_table!=NULL' is redundant or there is possible null pointer dereference: allowed_vdd_mclk_table. [nullPointerRedundantCheck]
    PP_ASSERT_WITH_CODE(allowed_vdd_mclk_table->count >= 1,
                        ^
   drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:704:45: note: Assuming that condition 'allowed_vdd_mclk_table!=NULL' is not redundant
    PP_ASSERT_WITH_CODE(allowed_vdd_mclk_table != NULL,
                                               ^
   drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:687:22: note: Null pointer dereference
    PP_ASSERT_WITH_CODE(allowed_vdd_mclk_table->count >= 1,
                        ^
>> drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:1745:6: warning: Either the condition 'table_info==NULL' is redundant or there is possible null pointer dereference: table_info. [nullPointerRedundantCheck]
        table_info->vddc_lookup_table, vv_id, &sclk)) {
        ^
   drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:1748:21: note: Assuming that condition 'table_info==NULL' is not redundant
        if (table_info == NULL)
                       ^
   drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:1745:6: note: Null pointer dereference
        table_info->vddc_lookup_table, vv_id, &sclk)) {
        ^
>> drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:3708:25: warning: Variable 'data->force_pcie_gen' is reassigned a value before the old one has been used. 'break;' missing? [redundantAssignInSwitch]
      data->force_pcie_gen = smu7_get_current_pcie_speed(hwmgr);
                           ^
   drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:3698:25: note: Variable 'data->force_pcie_gen' is reassigned a value before the old one has been used. 'break;' missing?
      data->force_pcie_gen = PP_PCIEGen2;
                           ^
   drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:3708:25: note: Variable 'data->force_pcie_gen' is reassigned a value before the old one has been used. 'break;' missing?
      data->force_pcie_gen = smu7_get_current_pcie_speed(hwmgr);
                           ^
--
   In file included from drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu10_hwmgr.c:
>> drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c:917:12: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
      size += sprintf(buf + size, "%d: %uMhz %sn",
              ^
   drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c:1266:11: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
     size += sprintf(buf + size, "%3d %14s%s: %14d %3d %10d %14dn",
             ^
>> drivers/gpu/drm/amd/powerplay/arcturus_ppt.c:1037:9: warning: Identical condition 'ret', second condition is always false [identicalConditionAfterEarlyExit]
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/arcturus_ppt.c:1032:6: note: first condition
    if (ret)
        ^
   drivers/gpu/drm/amd/powerplay/arcturus_ppt.c:1037:9: note: second condition
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/arcturus_ppt.c:1057:9: warning: Identical condition 'ret', second condition is always false [identicalConditionAfterEarlyExit]
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/arcturus_ppt.c:1051:6: note: first condition
    if (ret)
        ^
   drivers/gpu/drm/amd/powerplay/arcturus_ppt.c:1057:9: note: second condition
    return ret;
           ^
>> drivers/gpu/drm/amd/powerplay/arcturus_ppt.c:1387:11: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
     size += sprintf(buf + size, "%2d %14s%sn",
             ^
>> drivers/gpu/drm/amd/powerplay/navi10_ppt.c:723:9: warning: Identical condition 'ret', second condition is always false [identicalConditionAfterEarlyExit]
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:714:6: note: first condition
    if (ret)
        ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:723:9: note: second condition
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1001:9: warning: Identical condition 'ret', second condition is always false [identicalConditionAfterEarlyExit]
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:996:6: note: first condition
    if (ret)
        ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1001:9: note: second condition
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1203:9: warning: Identical condition 'ret', second condition is always false [identicalConditionAfterEarlyExit]
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1198:6: note: first condition
    if (ret)
        ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1203:9: note: second condition
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1221:9: warning: Identical condition 'ret', second condition is always false [identicalConditionAfterEarlyExit]
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1215:6: note: first condition
    if (ret)
        ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1221:9: note: second condition
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1690:9: warning: Identical condition 'ret', second condition is always false [identicalConditionAfterEarlyExit]
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1687:6: note: first condition
    if (ret)
        ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1690:9: note: second condition
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1758:9: warning: Identical condition 'ret', second condition is always false [identicalConditionAfterEarlyExit]
    return ret;
           ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1755:6: note: first condition
    if (ret)
        ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1758:9: note: second condition
    return ret;
           ^
>> drivers/gpu/drm/amd/powerplay/navi10_ppt.c:882:12: warning: %u in format string (no. 3) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint]
      size += sprintf(buf + size, "%d: %uMHz @ %umVn", i, curve_settings[0], curve_settings[1] / NAVI10_VOLTAGE_SCALE);
              ^
>> drivers/gpu/drm/amd/powerplay/navi10_ppt.c:913:12: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
      size += sprintf(buf + size, "VDDC_CURVE_VOLT[0]: %7dmV %11dmVn",
              ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:913:12: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
      size += sprintf(buf + size, "VDDC_CURVE_VOLT[0]: %7dmV %11dmVn",
              ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:921:12: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
      size += sprintf(buf + size, "VDDC_CURVE_VOLT[1]: %7dmV %11dmVn",
              ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:921:12: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
      size += sprintf(buf + size, "VDDC_CURVE_VOLT[1]: %7dmV %11dmVn",
              ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:929:12: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
      size += sprintf(buf + size, "VDDC_CURVE_VOLT[2]: %7dmV %11dmVn",
              ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:929:12: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
      size += sprintf(buf + size, "VDDC_CURVE_VOLT[2]: %7dmV %11dmVn",
              ^
   drivers/gpu/drm/amd/powerplay/navi10_ppt.c:1272:11: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
     size += sprintf(buf + size, "%2d %14s%s:n",
             ^
>> drivers/gpu/drm/amd/display/dc/core/dc_link.c:398:10: warning: Variable 'present' is reassigned a value before the old one has been used. [redundantAssignment]
    present = (gpio_result == GPIO_RESULT_OK) && !clock_pin;
            ^
   drivers/gpu/drm/amd/display/dc/core/dc_link.c:358:0: note: Variable 'present' is reassigned a value before the old one has been used.
    bool present =
   ^
   drivers/gpu/drm/amd/display/dc/core/dc_link.c:398:10: note: Variable 'present' is reassigned a value before the old one has been used.
    present = (gpio_result == GPIO_RESULT_OK) && !clock_pin;
            ^
>> drivers/gpu/drm/amd/display/dc/core/dc_link.c:3342:6: warning: Uninitialized variable: link_stream [uninitvar]
    if (link_stream->dpms_off)
        ^
--
   In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:
>> drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:1897:15: warning: Variable 'max_link_cap' is reassigned a value before the old one has been used. [redundantAssignment]
    max_link_cap = get_max_link_cap(link);
                 ^
   drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:1877:0: note: Variable 'max_link_cap' is reassigned a value before the old one has been used.
    struct dc_link_settings max_link_cap = {0};
   ^
   drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:1897:15: note: Variable 'max_link_cap' is reassigned a value before the old one has been used.
    max_link_cap = get_max_link_cap(link);
                 ^
>> drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:1919:24: warning: Variable 'initial_link_settings' is reassigned a value before the old one has been used. [redundantAssignment]
    initial_link_settings = get_common_supported_link_settings(
                          ^
   drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:1880:0: note: Variable 'initial_link_settings' is reassigned a value before the old one has been used.
    struct dc_link_settings initial_link_settings = {0};
   ^
   drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:1919:24: note: Variable 'initial_link_settings' is reassigned a value before the old one has been used.
    initial_link_settings = get_common_supported_link_settings(
                          ^
   drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:2030:15: warning: Variable 'max_link_cap' is reassigned a value before the old one has been used. [redundantAssignment]
    max_link_cap = get_max_link_cap(link);
                 ^
   drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:2028:0: note: Variable 'max_link_cap' is reassigned a value before the old one has been used.
    struct dc_link_settings max_link_cap = {0};
   ^
   drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:2030:15: note: Variable 'max_link_cap' is reassigned a value before the old one has been used.
    max_link_cap = get_max_link_cap(link);
                 ^
>> drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:3465:10: warning: Variable 'status' is reassigned a value before the old one has been used. [redundantAssignment]
     status = core_link_read_dpcd(
            ^
   drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:3460:10: note: Variable 'status' is reassigned a value before the old one has been used.
     status = core_link_read_dpcd(
            ^
   drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:3465:10: note: Variable 'status' is reassigned a value before the old one has been used.
     status = core_link_read_dpcd(
            ^
   drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:3470:10: warning: Variable 'status' is reassigned a value before the old one has been used. [redundantAssignment]
     status = core_link_read_dpcd(
            ^
   drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:3465:10: note: Variable 'status' is reassigned a value before the old one has been used.
     status = core_link_read_dpcd(
            ^
   drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c:3470:10: note: Variable 'status' is reassigned a value before the old one has been used.
     status = core_link_read_dpcd(
            ^

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=57430471e2fa60a412e220fa3014567e792aaa6f
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 57430471e2fa60a412e220fa3014567e792aaa6f
vim +1855 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

  1836	
  1837	static ssize_t psp_usbc_pd_fw_sysfs_read(struct device *dev,
  1838						 struct device_attribute *attr,
  1839						 char *buf)
  1840	{
  1841		struct drm_device *ddev = dev_get_drvdata(dev);
  1842		struct amdgpu_device *adev = ddev->dev_private;
  1843		uint32_t fw_ver;
  1844		int ret;
  1845	
  1846		mutex_lock(&adev->psp.mutex);
  1847		ret = psp_read_usbc_pd_fw(&adev->psp, &fw_ver);
  1848		mutex_unlock(&adev->psp.mutex);
  1849	
  1850		if (ret) {
  1851			DRM_ERROR("Failed to read USBC PD FW, err = %d", ret);
  1852			return ret;
  1853		}
  1854	
> 1855		return snprintf(buf, PAGE_SIZE, "%x\n", fw_ver);
  1856	}
  1857	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ