]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: off by one in amdgpu_device_attr_create_groups() error handling
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 20 May 2020 15:25:56 +0000 (18:25 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 21 May 2020 16:48:43 +0000 (12:48 -0400)
commitf7759ed7c0769a3182280234a706d0eaf4a4a316
tree3d2cde0070633b331233887e16bcdb2383fccc60
parent5c1c1f6c7062e996c931a6c72c9f62933a35d42f
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: 2bdd0798fc9c ("drm/amdgpu: optimize amdgpu device attribute code")
Acked-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c