提交 3f12325a 编写于 作者: R Ravikant B Sharma 提交者: Alex Deucher

drm/amd/amdgpu : Fix NULL pointer comparison

Replace direct comparisons to NULL i.e.
'x == NULL' with '!x'. As per coding standard.
Reviewed-by: NChristian König <christian.koenig@amd.com>
Signed-off-by: NRavikant B Sharma <ravikant.s2@samsung.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 bc24fbe9
...@@ -70,7 +70,7 @@ static bool igp_read_bios_from_vram(struct amdgpu_device *adev) ...@@ -70,7 +70,7 @@ static bool igp_read_bios_from_vram(struct amdgpu_device *adev)
return false; return false;
} }
adev->bios = kmalloc(size, GFP_KERNEL); adev->bios = kmalloc(size, GFP_KERNEL);
if (adev->bios == NULL) { if (!adev->bios) {
iounmap(bios); iounmap(bios);
return false; return false;
} }
......
...@@ -327,9 +327,8 @@ int amdgpu_sa_bo_new(struct amdgpu_sa_manager *sa_manager, ...@@ -327,9 +327,8 @@ int amdgpu_sa_bo_new(struct amdgpu_sa_manager *sa_manager,
return -EINVAL; return -EINVAL;
*sa_bo = kmalloc(sizeof(struct amdgpu_sa_bo), GFP_KERNEL); *sa_bo = kmalloc(sizeof(struct amdgpu_sa_bo), GFP_KERNEL);
if ((*sa_bo) == NULL) { if (!(*sa_bo))
return -ENOMEM; return -ENOMEM;
}
(*sa_bo)->manager = sa_manager; (*sa_bo)->manager = sa_manager;
(*sa_bo)->fence = NULL; (*sa_bo)->fence = NULL;
INIT_LIST_HEAD(&(*sa_bo)->olist); INIT_LIST_HEAD(&(*sa_bo)->olist);
......
...@@ -3904,7 +3904,7 @@ static int gfx_v8_0_init_save_restore_list(struct amdgpu_device *adev) ...@@ -3904,7 +3904,7 @@ static int gfx_v8_0_init_save_restore_list(struct amdgpu_device *adev)
int list_size; int list_size;
unsigned int *register_list_format = unsigned int *register_list_format =
kmalloc(adev->gfx.rlc.reg_list_format_size_bytes, GFP_KERNEL); kmalloc(adev->gfx.rlc.reg_list_format_size_bytes, GFP_KERNEL);
if (register_list_format == NULL) if (!register_list_format)
return -ENOMEM; return -ENOMEM;
memcpy(register_list_format, adev->gfx.rlc.register_list_format, memcpy(register_list_format, adev->gfx.rlc.register_list_format,
adev->gfx.rlc.reg_list_format_size_bytes); adev->gfx.rlc.reg_list_format_size_bytes);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册