Re: [PATCH] mtd: nand: gpmi: Fix a double free in gpmi_nand_init

2021-04-07 Thread Miquel Raynal
On Sat, 2021-04-03 at 06:09:05 UTC, Lv Yunlong wrote: > If the callee gpmi_alloc_dma_buffer() failed to alloc memory for > this->raw_buffer, gpmi_free_dma_buffer() will be called to free > this->auxiliary_virt. But this->auxiliary_virt is still a non-NULL > and valid ptr. > > Then gpmi_alloc_dma_b

[PATCH] mtd: nand: gpmi: Fix a double free in gpmi_nand_init

2021-04-02 Thread Lv Yunlong
If the callee gpmi_alloc_dma_buffer() failed to alloc memory for this->raw_buffer, gpmi_free_dma_buffer() will be called to free this->auxiliary_virt. But this->auxiliary_virt is still a non-NULL and valid ptr. Then gpmi_alloc_dma_buffer() returns err and gpmi_free_dma_buffer() is called again to