Skip to contentSkip to conversation

drm/amdgpu: Fix potential uninitialized use of 'idle' in amdgpu_ids.c

PATCH Superseded Harry Wentland 2 participants 2 messages Feb 9, 2018 1 message not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix potential uninitialized use of 'idle' in amdgpu_ids.c

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +2 -1
index 7d2805729c20..0a0f2eb67c01 100644
@@ -406,7 +406,8 @@ int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
 	struct amdgpu_device *adev = ring->adev;
 	unsigned vmhub = ring->funcs->vmhub;
 	struct amdgpu_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub];
-	struct amdgpu_vmid *id, *idle;
+	struct amdgpu_vmid *id = 0;
+	struct amdgpu_vmid *idle = 0;
 	int r = 0;
 
 	mutex_lock(&id_mgr->lock);
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180209172838.16633-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 09.02.2018 um 18:28 schrieb Harry Wentland:

Quoted 10 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +0 -0
index 7d2805729c20..0a0f2eb67c01 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring, · line 410

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +2 -1
@@ -406,7 +406,8 @@ int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
  	struct amdgpu_device *adev = ring->adev;
  	unsigned vmhub = ring->funcs->vmhub;
  	struct amdgpu_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub];
-	struct amdgpu_vmid *id, *idle;
+	struct amdgpu_vmid *id = 0;
+	struct amdgpu_vmid *idle = 0;

Please use NULL not zero for initialization and reverse xmas tree order e.g. longest line first.

Apart from that looks good to me,
Christian.

drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c int amdgpu_vmid_grab(struct amdgpu_vm *vm, struct amdgpu_ring *ring, · line 413

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +0 -0
  	int r = 0;
 
  	mutex_lock(&id_mgr->lock);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx