Re: (subset) [PATCH] drm/imagination: fix off by one in pvr_vm_mips_init() error handling

2023-11-30 Thread Maxime Ripard
On Thu, 30 Nov 2023 10:27:15 +0300, Dan Carpenter wrote: > If the call to vmap() fails the "page_nr" is one element beyond the end > of the mips_data->pt_dma_addr[] and mips_data->pt_pages[] arrays. > > The way that this is traditionally written is that we clean up the > partial loop iteration

Re: [PATCH] drm/imagination: fix off by one in pvr_vm_mips_init() error handling

2023-11-30 Thread Frank Binns
On Thu, 2023-11-30 at 10:27 +0300, Dan Carpenter wrote: > If the call to vmap() fails the "page_nr" is one element beyond the end > of the mips_data->pt_dma_addr[] and mips_data->pt_pages[] arrays. > > The way that this is traditionally written is that we clean up the > partial loop iteration

[PATCH] drm/imagination: fix off by one in pvr_vm_mips_init() error handling

2023-11-29 Thread Dan Carpenter
If the call to vmap() fails the "page_nr" is one element beyond the end of the mips_data->pt_dma_addr[] and mips_data->pt_pages[] arrays. The way that this is traditionally written is that we clean up the partial loop iteration before the goto and then we can say while (--i >= 0). At that point