Re: Re: [PATCH] drm/lima: fix a memleak in lima_heap_alloc

2024-01-16 Thread alexious
> Thanks for the fix. As the error handling gets longer and duplicated, > could you rearrange them like the lima_gem_submit(): > err_out2: > dma_unmap_sgtable(dev, &sgt, DMA_BIDIRECTIONAL, 0); > err_out1: > kfree(bo->base.sgt); > bo->base.sgt = NULL; > err_out0: > sg_free_table(&sgt

Re: [PATCH] drm/lima: fix a memleak in lima_heap_alloc

2024-01-15 Thread Qiang Yu
Thanks for the fix. As the error handling gets longer and duplicated, could you rearrange them like the lima_gem_submit(): err_out2: dma_unmap_sgtable(dev, &sgt, DMA_BIDIRECTIONAL, 0); err_out1: kfree(bo->base.sgt); bo->base.sgt = NULL; err_out0: sg_free_table(&sgt); return ret.