Re: [PATCH] crypto: qat: Fix a double free in adf_create_ring

2021-04-09 Thread Herbert Xu
On Fri, Apr 02, 2021 at 10:13:48AM -0700, Lv Yunlong wrote: > In adf_create_ring, if the callee adf_init_ring() failed, the callee will > free the ring->base_addr by dma_free_coherent() and return -EFAULT. Then > adf_create_ring will goto err and the ring->base_addr will be freed again > in

[PATCH] crypto: qat: Fix a double free in adf_create_ring

2021-04-02 Thread Lv Yunlong
In adf_create_ring, if the callee adf_init_ring() failed, the callee will free the ring->base_addr by dma_free_coherent() and return -EFAULT. Then adf_create_ring will goto err and the ring->base_addr will be freed again in adf_cleanup_ring(). My patch sets ring->base_addr to NULL after the first