Re: [PATCH v2] nouveau/dmem: handle kcalloc() allocation failure

2024-03-05 Thread Danilo Krummrich
Hi Duoming, thanks for sending a V2. On 3/5/24 15:39, Duoming Zhou wrote: The kcalloc() in nouveau_dmem_evict_chunk() will return null if the physical memory has run out. As a result, if we dereference src_pfns, dst_pfns or dma_addrs, the null pointer dereference bugs will happen. Moreover,

[PATCH v2] nouveau/dmem: handle kcalloc() allocation failure

2024-03-05 Thread Duoming Zhou
The kcalloc() in nouveau_dmem_evict_chunk() will return null if the physical memory has run out. As a result, if we dereference src_pfns, dst_pfns or dma_addrs, the null pointer dereference bugs will happen. Moreover, the GPU is going away. If the kcalloc() fails, we could not evict all pages