gpu: nvgpu: remove logically dead code

In nvgpu_vm_map(), variable "inserted" can never be
true in error path
Hence remove the logically dead code

Bug 200291879
Coverity id : 2567920

Change-Id: I5428f7d52f1d4f815c04d90ea651668dd72ba985
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1495906
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
This commit is contained in:
Deepak Nibade
2017-06-05 14:42:38 +05:30
committed by mobile promotions
parent fe86835633
commit 793bc318c5

View File

@@ -188,7 +188,7 @@ u64 nvgpu_vm_map(struct vm_gk20a *vm,
struct gk20a *g = gk20a_from_vm(vm);
struct gk20a_comptag_allocator *ctag_allocator = &g->gr.comp_tags;
struct nvgpu_mapped_buf *mapped_buffer = NULL;
bool inserted = false, va_allocated = false;
bool va_allocated = false;
u64 map_offset = 0;
int err = 0;
struct buffer_attrs bfr = {NULL};
@@ -372,7 +372,6 @@ u64 nvgpu_vm_map(struct vm_gk20a *vm,
nvgpu_err(g, "failed to insert into mapped buffer tree");
goto clean_up;
}
inserted = true;
if (user_mapped)
vm->num_user_mapped_buffers++;
@@ -387,11 +386,6 @@ u64 nvgpu_vm_map(struct vm_gk20a *vm,
return map_offset;
clean_up:
if (inserted) {
nvgpu_remove_mapped_buf(vm, mapped_buffer);
if (user_mapped)
vm->num_user_mapped_buffers--;
}
nvgpu_kfree(g, mapped_buffer);
if (va_allocated)
__nvgpu_vm_free_va(vm, map_offset, bfr.pgsz_idx);