public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org>
Cc: "Zhou,
	David(ChunMing)" <David1.Zhou-5C7GfCeVMHo@public.gmane.org>,
	"Gui, Jack" <Jack.Gui-5C7GfCeVMHo@public.gmane.org>,
	David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
	"Wang, Kevin(Yang)" <Kevin1.Wang-5C7GfCeVMHo@public.gmane.org>,
	"kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"Huang, Ray" <Ray.Huang-5C7GfCeVMHo@public.gmane.org>,
	Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>,
	"Deucher,
	Alexander" <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>,
	"Gao, Likun" <Likun.Gao-5C7GfCeVMHo@public.gmane.org>,
	"Koenig,
	Christian" <Christian.Koenig-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH] drm/amd/powerplay: Fix double unlock bug in smu_sys_set_pp_table()
Date: Thu, 21 Mar 2019 08:23:29 +0000	[thread overview]
Message-ID: <20190321082329.GV2227@kadam> (raw)
In-Reply-To: <alpine.DEB.2.20.1903210920230.5292@hadrien>

On Thu, Mar 21, 2019 at 09:20:38AM +0100, Julia Lawall wrote:
> 
> 
> On Thu, 21 Mar 2019, Huang, Ray wrote:
> 
> > > -----Original Message-----
> > > From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> > > Sent: Thursday, March 21, 2019 2:28 PM
> > > To: Deucher, Alexander <Alexander.Deucher@amd.com>; Wang, Kevin(Yang)
> > > <Kevin1.Wang@amd.com>
> > > Cc: Koenig, Christian <Christian.Koenig@amd.com>; Zhou, David(ChunMing)
> > > <David1.Zhou@amd.com>; David Airlie <airlied@linux.ie>; Daniel Vetter
> > > <daniel@ffwll.ch>; Huang, Ray <Ray.Huang@amd.com>; Gao, Likun
> > > <Likun.Gao@amd.com>; Gui, Jack <Jack.Gui@amd.com>; amd-
> > > gfx@lists.freedesktop.org; kernel-janitors@vger.kernel.org
> > > 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@oracle.com>
> >
> > Nice catch!  Thanks, Dan.
> > Kevin, could you please verify this patch.
> > Reviewed-by: Huang Rui <ray.huang@amd.com>
> >
> > > ---
> > > 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?

It's not necessarily zero.

regards,
dan carpenter

  reply	other threads:[~2019-03-21  8:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21  6:28 [PATCH] drm/amd/powerplay: Fix double unlock bug in smu_sys_set_pp_table() Dan Carpenter
2019-03-21  6:52 ` Huang, Ray
     [not found]   ` <MN2PR12MB3309B7C391B32EB8F5F87676EC420-rweVpJHSKTpWdvXm18W95QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-03-21  8:20     ` Julia Lawall
2019-03-21  8:23       ` Dan Carpenter [this message]
2019-03-21  8:26         ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190321082329.GV2227@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=Alexander.Deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=Christian.Koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=David1.Zhou-5C7GfCeVMHo@public.gmane.org \
    --cc=Jack.Gui-5C7GfCeVMHo@public.gmane.org \
    --cc=Kevin1.Wang-5C7GfCeVMHo@public.gmane.org \
    --cc=Likun.Gao-5C7GfCeVMHo@public.gmane.org \
    --cc=Ray.Huang-5C7GfCeVMHo@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=daniel-/w4YWyX8dFk@public.gmane.org \
    --cc=julia.lawall-L2FTfq7BK8M@public.gmane.org \
    --cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox