dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>, Kevin Wang <kevin1.wang@amd.com>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"Ruhl, Michael J" <michael.j.ruhl@intel.com>,
	Rui Huang <ray.huang@amd.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Alex Deucher <alexander.deucher@amd.com>,
	Yintian Tao <yttao@amd.com>, Evan Quan <evan.quan@amd.com>,
	Kenneth Feng <kenneth.feng@amd.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>
Subject: Re: [PATCH v3] drm/amdgpu: off by one in amdgpu_device_attr_create_groups() error handling
Date: Wed, 20 May 2020 14:39:04 -0400	[thread overview]
Message-ID: <CADnq5_PqSNzKOg_VVmZ_b9z6dqJiLGv-TNyv4Jpez=cUGKq+6g@mail.gmail.com> (raw)
In-Reply-To: <d8b26176-b3f7-500a-50f8-9282f615ec74@amd.com>


[-- Attachment #1.1: Type: text/plain, Size: 2507 bytes --]

Applied.  Thanks!

Alex

On Wed, May 20, 2020 at 11:33 AM Christian König <christian.koenig@amd.com>
wrote:

> Am 20.05.20 um 17:31 schrieb Ruhl, Michael J:
> >> -----Original Message-----
> >> From: Dan Carpenter <dan.carpenter@oracle.com>
> >> Sent: Wednesday, May 20, 2020 11:26 AM
> >> To: Alex Deucher <alexander.deucher@amd.com>; Kevin Wang
> >> <kevin1.wang@amd.com>; Ruhl, Michael J <michael.j.ruhl@intel.com>
> >> Cc: Christian König <christian.koenig@amd.com>; David Airlie
> >> <airlied@linux.ie>; Daniel Vetter <daniel@ffwll.ch>; Evan Quan
> >> <evan.quan@amd.com>; Rui Huang <ray.huang@amd.com>; Kenneth Feng
> >> <kenneth.feng@amd.com>; Yintian Tao <yttao@amd.com>; Hawking Zhang
> >> <Hawking.Zhang@amd.com>; amd-gfx@lists.freedesktop.org; dri-
> >> devel@lists.freedesktop.org; linux-kernel@vger.kernel.org; kernel-
> >> janitors@vger.kernel.org
> >> Subject: [PATCH v3] drm/amdgpu: off by one in
> >> amdgpu_device_attr_create_groups() error handling
> >>
> >> This loop in the error handling code should start a "i - 1" and end at
> >> "i == 0".  Currently it starts a "i" and ends at "i == 1".  The result
> >> is that it removes one attribute that wasn't created yet, and leaks the
> >> zeroeth attribute.
> >>
> >> Fixes: 4e01847c38f7 ("drm/amdgpu: optimize amdgpu device attribute
> code")
> >> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >> ---
> >> v2: style change
> >> v3: Fix embarrassing typo in the subject
> > 😊
> >
> > Acked-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
> >
> > m
> >> drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c           | 3 +--
> >> 1 files changed, 1 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> >> index b75362bf0742..e809534fabd4 100644
> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> >> @@ -1942,9 +1942,8 @@ static int amdgpu_device_attr_create_groups(struct
> >> amdgpu_device *adev,
> >>      return 0;
> >>
> >> failed:
> >> -    for (; i > 0; i--) {
> >> +    while (i--)
> >>              amdgpu_device_attr_remove(adev, &attrs[i]);
> >> -    }
> >>
> >>      return ret;
> >> }
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>

[-- Attachment #1.2: Type: text/html, Size: 4712 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2020-05-20 18:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 12:00 [PATCH] drm/amdgpu: off by on in amdgpu_device_attr_create_groups() error handling Dan Carpenter
2020-05-20 12:05 ` Christian König
2020-05-20 12:52   ` Dan Carpenter
2020-05-20 13:08     ` [PATCH v2] " Dan Carpenter
2020-05-20 13:38       ` Wang, Kevin(Yang)
2020-05-20 15:23       ` Ruhl, Michael J
2020-05-20 15:25         ` [PATCH v3] drm/amdgpu: off by one " Dan Carpenter
2020-05-20 15:31           ` Ruhl, Michael J
2020-05-20 15:32             ` Christian König
2020-05-20 18:39               ` Alex Deucher [this message]

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='CADnq5_PqSNzKOg_VVmZ_b9z6dqJiLGv-TNyv4Jpez=cUGKq+6g@mail.gmail.com' \
    --to=alexdeucher@gmail.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=evan.quan@amd.com \
    --cc=kenneth.feng@amd.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kevin1.wang@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.j.ruhl@intel.com \
    --cc=ray.huang@amd.com \
    --cc=yttao@amd.com \
    /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;
as well as URLs for NNTP newsgroup(s).