Applied. Thanks! Alex
On Sun, Feb 6, 2022 at 10:04 PM Quan, Evan <evan.q...@amd.com> wrote: > > [AMD Official Use Only] > > Reviewed-by: Evan Quan <evan.q...@amd.com> > > > -----Original Message----- > > From: t...@redhat.com <t...@redhat.com> > > Sent: Saturday, February 5, 2022 11:00 PM > > To: Quan, Evan <evan.q...@amd.com>; Deucher, Alexander > > <alexander.deuc...@amd.com>; Koenig, Christian > > <christian.koe...@amd.com>; Pan, Xinhui <xinhui....@amd.com>; > > airl...@linux.ie; dan...@ffwll.ch; nat...@kernel.org; > > ndesaulni...@google.com; Lazar, Lijo <lijo.la...@amd.com>; Powell, Darren > > <darren.pow...@amd.com>; Chen, Guchun <guchun.c...@amd.com>; > > Grodzovsky, Andrey <andrey.grodzov...@amd.com> > > Cc: amd-gfx@lists.freedesktop.org; dri-de...@lists.freedesktop.org; linux- > > ker...@vger.kernel.org; l...@lists.linux.dev; Tom Rix <t...@redhat.com> > > Subject: [PATCH] drm/amd/pm: fix error handling > > > > From: Tom Rix <t...@redhat.com> > > > > clang static analysis reports this error > > amdgpu_smu.c:2289:9: warning: Called function pointer > > is null (null dereference) > > return smu->ppt_funcs->emit_clk_levels( > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > There is a logic error in the earlier check of > > emit_clk_levels. The error value is set to > > the ret variable but ret is never used. Return > > directly and remove the unneeded ret variable. > > > > Fixes: 5d64f9bbb628 ("amdgpu/pm: Implement new API function "emit" that > > accepts buffer base and write offset") > > Signed-off-by: Tom Rix <t...@redhat.com> > > --- > > drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > > b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > > index af368aa1fd0ae..5f3b3745a9b7a 100644 > > --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > > +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > > @@ -2274,7 +2274,6 @@ static int smu_emit_ppclk_levels(void *handle, > > enum pp_clock_type type, char *bu > > { > > struct smu_context *smu = handle; > > enum smu_clk_type clk_type; > > - int ret = 0; > > > > clk_type = smu_convert_to_smuclk(type); > > if (clk_type == SMU_CLK_COUNT) > > @@ -2284,7 +2283,7 @@ static int smu_emit_ppclk_levels(void *handle, > > enum pp_clock_type type, char *bu > > return -EOPNOTSUPP; > > > > if (!smu->ppt_funcs->emit_clk_levels) > > - ret = -ENOENT; > > + return -ENOENT; > > > > return smu->ppt_funcs->emit_clk_levels(smu, clk_type, buf, offset); > > > > -- > > 2.26.3