lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <14063C7AD467DE4B82DEDB5C278E8663010E2302FA@FMSMSX108.amr.corp.intel.com>
Date:   Wed, 20 May 2020 15:23:52 +0000
From:   "Ruhl, Michael J" <michael.j.ruhl@...el.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>,
        Alex Deucher <alexander.deucher@....com>,
        Kevin Wang <kevin1.wang@....com>
CC:     David Airlie <airlied@...ux.ie>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "amd-gfx@...ts.freedesktop.org" <amd-gfx@...ts.freedesktop.org>,
        Hawking Zhang <Hawking.Zhang@....com>,
        "Rui Huang" <ray.huang@....com>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        Evan Quan <evan.quan@....com>,
        "Kenneth Feng" <kenneth.feng@....com>,
        Christian König <christian.koenig@....com>,
        Yintian Tao <yttao@....com>
Subject: RE: [PATCH v2] drm/amdgpu: off by on in
 amdgpu_device_attr_create_groups() error handling

"off by on"

or 

"off by one"

?

M

>-----Original Message-----
>From: dri-devel <dri-devel-bounces@...ts.freedesktop.org> On Behalf Of Dan
>Carpenter
>Sent: Wednesday, May 20, 2020 9:08 AM
>To: Alex Deucher <alexander.deucher@....com>; Kevin Wang
><kevin1.wang@....com>
>Cc: David Airlie <airlied@...ux.ie>; kernel-janitors@...r.kernel.org; linux-
>kernel@...r.kernel.org; amd-gfx@...ts.freedesktop.org; Hawking Zhang
><Hawking.Zhang@....com>; Rui Huang <ray.huang@....com>; dri-
>devel@...ts.freedesktop.org; Evan Quan <evan.quan@....com>; Kenneth
>Feng <kenneth.feng@....com>; Christian König
><christian.koenig@....com>; Yintian Tao <yttao@....com>
>Subject: [PATCH v2] drm/amdgpu: off by on 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@...cle.com>
>---
>v2: style change
>
> 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@...ts.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/dri-devel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ