瀏覽代碼

drivers/amdgpu: Remove redundant NULL check before kfree()

Found-by: Coccinelle
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Edward O'Callaghan 9 年之前
父節點
當前提交
a698e41782
共有 2 個文件被更改,包括 2 次插入4 次删除
  1. 1 2
      drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
  2. 1 2
      drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c

+ 1 - 2
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c

@@ -1065,8 +1065,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
 	}
 
 error:
-	if (obj != NULL)
-		kfree(obj);
+	kfree(obj);
 	kfree((void *)input.pointer);
 	return result;
 }

+ 1 - 2
drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c

@@ -77,8 +77,7 @@ int phm_dispatch_table(struct pp_hwmgr *hwmgr,
 
 	result = phm_run_table(hwmgr, rt_table, input, output, temp_storage);
 
-	if (NULL != temp_storage)
-		kfree(temp_storage);
+	kfree(temp_storage);
 
 	return result;
 }