Skip to content

Commit 2a4f069

Browse files
committed
drm: amdgpu: Allow NULL pointers at amdgpu_vm_put_task_info()
Allow NULL pointers at amdgpu_vm_put_task_info() as it common practice for "put" or "free" functions. This avoid an extra check for NULL for callers. Reviewed-by: Christian König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: André Almeida <[email protected]>
1 parent e252e3f commit 2a4f069

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2447,7 +2447,8 @@ amdgpu_vm_get_vm_from_pasid(struct amdgpu_device *adev, u32 pasid)
24472447
*/
24482448
void amdgpu_vm_put_task_info(struct amdgpu_task_info *task_info)
24492449
{
2450-
kref_put(&task_info->refcount, amdgpu_vm_destroy_task_info);
2450+
if (task_info)
2451+
kref_put(&task_info->refcount, amdgpu_vm_destroy_task_info);
24512452
}
24522453

24532454
/**

0 commit comments

Comments
 (0)