Catalin Marinas <[email protected]> writes: > On Mon, Sep 21, 2026 at 08:18:46PM +0530, Aneesh Kumar K.V (Arm) wrote: >> @@ -405,6 +396,7 @@ static struct dma_buf *system_heap_allocate(struct >> dma_heap *heap, >> { >> struct system_heap_buffer *buffer; >> DEFINE_DMA_BUF_EXPORT_INFO(exp_info); >> + struct cc_shared_layout layout; >> unsigned long size_remaining = len; >> unsigned long sg_remaining = len; >> unsigned int max_order = orders[0]; >> @@ -417,6 +409,14 @@ static struct dma_buf *system_heap_allocate(struct >> dma_heap *heap, >> struct page *page, *tmp_page; >> int i, ret = -ENOMEM; >> >> + if (cc_shared) { >> + ret = cc_shared_calc_layout(len, &layout); > > You should not override 'ret' here, it was set to -ENOMEM for a reason. > cc_shared_calc_layout() succeeds resetting 'ret' and some further down > allocation failure, goto free will return ERR_PTR(0).
Agreed. I’ll fix this in the next revision. -aneesh
