Skip to contentSkip to conversation

amdgpu_cs_bo_handles_chunk, remove check info NULL branch

PATCH New Bernard Zhao 1 participant 1 message Apr 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 amdgpu_cs_bo_handles_chunk, remove check info NULL branch

kvfree ensure that the null pointer will do nothing. If addr is NULL, first is_vmalloc_addr will not enter, and kfree function just return when addr is NULL. There will be no risk here.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +1 -2
index af91627b..814bd5d 100644
@@ -98,8 +98,7 @@ static int amdgpu_cs_bo_handles_chunk(struct amdgpu_cs_parser *p,
 	return 0;
 
 error_free:
-	if (info)
-		kvfree(info);
+	kvfree(info);
 
 	return r;
 }
Signature · 1 line
2.7.4