diff options
| author | 2020-04-21 21:35:44 +0800 | |
|---|---|---|
| committer | 2020-04-24 20:50:46 +0800 | |
| commit | 24943269e51bb6fd2810e71597b675878369e06b (patch) | |
| tree | e11786b1262446edfde8d2a04e1d10ebb330fbe4 /drivers/gpu/drm/lima/lima_vm.h | |
| parent | drm/lima: print process name and pid when task error (diff) | |
| download | wireguard-linux-24943269e51bb6fd2810e71597b675878369e06b.tar.xz wireguard-linux-24943269e51bb6fd2810e71597b675878369e06b.zip | |
drm/lima: check vm != NULL in lima_vm_put
No need to handle this check before calling lima_vm_put.
Tested-by: Bhushan Shah <bshah@kde.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200421133551.31481-4-yuq825@gmail.com
Diffstat (limited to 'drivers/gpu/drm/lima/lima_vm.h')
| -rw-r--r-- | drivers/gpu/drm/lima/lima_vm.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/lima/lima_vm.h b/drivers/gpu/drm/lima/lima_vm.h index 22aeec77d84d..3a7c74822d8b 100644 --- a/drivers/gpu/drm/lima/lima_vm.h +++ b/drivers/gpu/drm/lima/lima_vm.h @@ -54,7 +54,8 @@ static inline struct lima_vm *lima_vm_get(struct lima_vm *vm) static inline void lima_vm_put(struct lima_vm *vm) { - kref_put(&vm->refcount, lima_vm_release); + if (vm) + kref_put(&vm->refcount, lima_vm_release); } void lima_vm_print(struct lima_vm *vm); |
