From: Dan Carpenter Subject: [radeon-alex:amd-staging-drm-next 170/201] drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu_helper.c:663 smu_set_watermarks_for_clocks_ranges() error: we previously assumed 'wm_with_clock_ranges' could be null (see line 660) Date: Thu, 19 Apr 2018 07:56:48 +0300 Message-ID: <20180419045648.xwtrlcqv22gu4bq4@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kbuild-bounces@lists.01.org Sender: "kbuild" To: kbuild@01.org, Rex Zhu Cc: Huang Rui , kbuild-all@01.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org tree: git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next head: d64547a1cfa860e241b27723c88f86fa3d88d3d7 commit: d6c9a7dc86cd39146afb0f47c06b6f95d7dd4997 [170/201] drm/amd/pp: Move common code to smu_helper.c smatch warnings: drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu_helper.c:663 smu_set_watermarks_for_clocks_ranges() error: we previously assumed 'wm_with_clock_ranges' could be null (see line 660) git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git git remote update radeon-alex git checkout d6c9a7dc86cd39146afb0f47c06b6f95d7dd4997 vim +/wm_with_clock_ranges +663 drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu_helper.c d6c9a7dc Rex Zhu 2018-04-08 653 d6c9a7dc Rex Zhu 2018-04-08 654 int smu_set_watermarks_for_clocks_ranges(void *wt_table, d6c9a7dc Rex Zhu 2018-04-08 655 struct pp_wm_sets_with_clock_ranges_soc15 *wm_with_clock_ranges) d6c9a7dc Rex Zhu 2018-04-08 656 { d6c9a7dc Rex Zhu 2018-04-08 657 uint32_t i; d6c9a7dc Rex Zhu 2018-04-08 658 struct watermarks *table = wt_table; d6c9a7dc Rex Zhu 2018-04-08 659 d6c9a7dc Rex Zhu 2018-04-08 @660 if (!table || wm_with_clock_ranges) ^^^^^^^^^^^^^^^^^^^^ This test is inverted. We should be checking if it's NULL not non-NULL. d6c9a7dc Rex Zhu 2018-04-08 661 return -EINVAL; d6c9a7dc Rex Zhu 2018-04-08 662 d6c9a7dc Rex Zhu 2018-04-08 @663 if (wm_with_clock_ranges->num_wm_sets_dmif > 4 || wm_with_clock_ranges->num_wm_sets_mcif > 4)