mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:16:01 +03:00
gpu: nvgpu: gv11b: release eng_method_buffers
In case of any error while allocating eng_method_buffers release allocated buffers gracefully. Change-Id: Ic9d86b63d2405fd0113e63f2fc3f96166a4de9b5 Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1541510 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
ddeadd8cf2
commit
5df1d3ff7a
@@ -1543,7 +1543,8 @@ void gv11b_fifo_init_eng_method_buffers(struct gk20a *g,
|
|||||||
{
|
{
|
||||||
struct vm_gk20a *vm = g->mm.bar2.vm;
|
struct vm_gk20a *vm = g->mm.bar2.vm;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
unsigned int i, runque, method_buffer_size;
|
int i;
|
||||||
|
unsigned int runque, method_buffer_size;
|
||||||
unsigned int num_pbdma = g->fifo.num_pbdma;
|
unsigned int num_pbdma = g->fifo.num_pbdma;
|
||||||
|
|
||||||
if (tsg->eng_method_buffers != NULL)
|
if (tsg->eng_method_buffers != NULL)
|
||||||
@@ -1565,9 +1566,9 @@ void gv11b_fifo_init_eng_method_buffers(struct gk20a *g,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (err) {
|
if (err) {
|
||||||
for (i = runque; i < runque; i--)
|
for (i = (runque - 1); i >= 0; i--)
|
||||||
nvgpu_dma_unmap_free(vm,
|
nvgpu_dma_unmap_free(vm,
|
||||||
&tsg->eng_method_buffers[runque]);
|
&tsg->eng_method_buffers[i]);
|
||||||
|
|
||||||
nvgpu_kfree(g, tsg->eng_method_buffers);
|
nvgpu_kfree(g, tsg->eng_method_buffers);
|
||||||
tsg->eng_method_buffers = NULL;
|
tsg->eng_method_buffers = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user