diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2016-04-13 03:54:01 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-04-14 11:42:35 -0400 |
commit | f22df728deb90f1c32318dbeaf011389df8ecb59 (patch) | |
tree | e78e8a3939862ea78da0e24ce9193d582cb5c6d6 /drivers/gpu/nvgpu/gk20a/gk20a.h | |
parent | 289cb4d9bdb7db478397a98f8eb56d60e04a6bfc (diff) |
gpu: nvgpu: free global ctx bufs only if allocated
Try to free only allocated buffers in
gr_gk20a_free_global_ctx_buffers(), otherwise the destroy function
pointer would be NULL and crash for nonallocated buffers. This can
happen when init fails for some of the buffers. Additionally, make the
pointer NULL when a buffer is destroyed, to signify this state.
Also refactor the function upwards and call it from
gr_gk20a_alloc_global_ctx_buffers() to reduce code duplication.
Change-Id: I6e74795014f5e315b5f8342f544ddfccc0d02b71
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1126026
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
0 files changed, 0 insertions, 0 deletions