On Thu, 21 Mar 2019, Huang, Ray wrote: > > -----Original Message----- > > From: Dan Carpenter [mailto:dan.carpenter@xxxxxxxxxx] > > Sent: Thursday, March 21, 2019 2:28 PM > > To: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Wang, Kevin(Yang) > > <Kevin1.Wang@xxxxxxx> > > Cc: Koenig, Christian <Christian.Koenig@xxxxxxx>; Zhou, David(ChunMing) > > <David1.Zhou@xxxxxxx>; David Airlie <airlied@xxxxxxxx>; Daniel Vetter > > <daniel@xxxxxxxx>; Huang, Ray <Ray.Huang@xxxxxxx>; Gao, Likun > > <Likun.Gao@xxxxxxx>; Gui, Jack <Jack.Gui@xxxxxxx>; amd- > > gfx@xxxxxxxxxxxxxxxxxxxxx; kernel-janitors@xxxxxxxxxxxxxxx > > Subject: [PATCH] drm/amd/powerplay: Fix double unlock bug in > > smu_sys_set_pp_table() > > > > We already unlocked a few lines earlier so this code unlocks twice on the > > success path. > > > > Fixes: 5809d7420f97 ("drm/amd/powerplay: implement sysfs of pp_table for > > smu11 (v2)") > > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> > > Nice catch! Thanks, Dan. > Kevin, could you please verify this patch. > Reviewed-by: Huang Rui <ray.huang@xxxxxxx> > > > --- > > I'm not sure what this bug looks like at runtime, but it's slightly weird that no > > one noticed. This is from static analysis and I haven't tested it myself. > > > > drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c > > b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c > > index 00b7c885772b..7e8c74da6a74 100644 > > --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c > > +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c > > @@ -187,6 +187,8 @@ int smu_sys_set_pp_table(struct smu_context *smu, > > void *buf, size_t size) > > if (ret) > > pr_info("smu reset failed, ret = %d\n", ret); > > > > + return ret; Why not return 0? julia > > + > > failed: > > mutex_unlock(&smu->mutex); > > return ret; > > -- > > 2.17.1 > > _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx