On Wed, 03 Mar 2021 10:23:01 +0800, Alex Deucher wrote: > > On Tue, Mar 2, 2021 at 9:16 PM Chen Li <chenli@xxxxxxxxxxxxx> wrote: > > > > > > The number of chunks/chunks_array may be passed in > > by userspace and can be large. > > > > We also need to kvfree these. Thanks for pointing out this! I will a add it in v3. > > Alex > > > Signed-off-by: Chen Li <chenli@xxxxxxxxxxxxx> > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c > > index 3e240b952e79..aefb7e68977d 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c > > @@ -117,7 +117,7 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, union drm_amdgpu_cs > > if (cs->in.num_chunks == 0) > > return 0; > > > > - chunk_array = kmalloc_array(cs->in.num_chunks, sizeof(uint64_t), GFP_KERNEL); > > + chunk_array = kvmalloc_array(cs->in.num_chunks, sizeof(uint64_t), GFP_KERNEL); > > if (!chunk_array) > > return -ENOMEM; > > > > @@ -144,7 +144,7 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, union drm_amdgpu_cs > > } > > > > p->nchunks = cs->in.num_chunks; > > - p->chunks = kmalloc_array(p->nchunks, sizeof(struct amdgpu_cs_chunk), > > + p->chunks = kvmalloc_array(p->nchunks, sizeof(struct amdgpu_cs_chunk), > > GFP_KERNEL); > > if (!p->chunks) { > > ret = -ENOMEM; > > -- > > 2.30.0 > > > > > > > > _______________________________________________ > > amd-gfx mailing list > > amd-gfx@xxxxxxxxxxxxxxxxxxxxx > > https://lists.freedesktop.org/mailman/listinfo/amd-gfx > > _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx