Re: [Intel-gfx] [PATCH] dma-buf/dma-resv: Stop leaking on krealloc() failure

2023-07-14 Thread Ville Syrjälä
On Fri, Jul 14, 2023 at 08:56:15AM +0200, Christian König wrote: > Am 13.07.23 um 21:47 schrieb Ville Syrjala: > > From: Ville Syrjälä > > > > Currently dma_resv_get_fences() will leak the previously > > allocated array if the fence iteration got restarted and > > the krealloc_array() fails. > >

Re: [Intel-gfx] [PATCH] dma-buf/dma-resv: Stop leaking on krealloc() failure

2023-07-14 Thread Christian König
Am 13.07.23 um 21:47 schrieb Ville Syrjala: From: Ville Syrjälä Currently dma_resv_get_fences() will leak the previously allocated array if the fence iteration got restarted and the krealloc_array() fails. Free the old array by hand, and make sure we still clear the returned *fences so the

[Intel-gfx] [PATCH] dma-buf/dma-resv: Stop leaking on krealloc() failure

2023-07-13 Thread Ville Syrjala
From: Ville Syrjälä Currently dma_resv_get_fences() will leak the previously allocated array if the fence iteration got restarted and the krealloc_array() fails. Free the old array by hand, and make sure we still clear the returned *fences so the caller won't end up accessing freed memory. Some