Re: [PATCH] radeon: use kvcalloc for relocs and chunks

2021-03-17 Thread Chen Li
On Wed, 17 Mar 2021 17:19:11 +0800, Chen Li wrote: > > On Wed, 17 Mar 2021 15:55:47 +0800, > Christian König wrote: > > > > Am 17.03.21 um 07:22 schrieb Chen Li: > > > kvmalloc_array + __GFP_ZERO is the same with kvcalloc. > > > > > > As for p->chunks, it will be used in: > > > ``` > > > if (ib_

Re: [PATCH] radeon: use kvcalloc for relocs and chunks

2021-03-17 Thread Chen Li
On Wed, 17 Mar 2021 15:55:47 +0800, Christian König wrote: > > Am 17.03.21 um 07:22 schrieb Chen Li: > > kvmalloc_array + __GFP_ZERO is the same with kvcalloc. > > > > As for p->chunks, it will be used in: > > ``` > > if (ib_chunk->kdata) > > memcpy(parser->ib.ptr, ib_chunk->kdata, ib

Re: [PATCH] radeon: use kvcalloc for relocs and chunks

2021-03-17 Thread Christian König
Am 17.03.21 um 10:40 schrieb Chen Li: On Wed, 17 Mar 2021 17:19:11 +0800, Chen Li wrote: On Wed, 17 Mar 2021 15:55:47 +0800, Christian König wrote: Am 17.03.21 um 07:22 schrieb Chen Li: kvmalloc_array + __GFP_ZERO is the same with kvcalloc. As for p->chunks, it will be used in: ``` if (ib_c

Re: [PATCH] radeon: use kvcalloc for relocs and chunks

2021-03-17 Thread Christian König
Am 17.03.21 um 10:19 schrieb Chen Li: On Wed, 17 Mar 2021 15:55:47 +0800, Christian König wrote: Am 17.03.21 um 07:22 schrieb Chen Li: kvmalloc_array + __GFP_ZERO is the same with kvcalloc. As for p->chunks, it will be used in: ``` if (ib_chunk->kdata) memcpy(parser->ib.ptr, ib

[PATCH] radeon: use kvcalloc for relocs and chunks

2021-03-17 Thread Chen Li
kvmalloc_array + __GFP_ZERO is the same with kvcalloc. As for p->chunks, it will be used in: ``` if (ib_chunk->kdata) memcpy(parser->ib.ptr, ib_chunk->kdata, ib_chunk->length_dw * 4); ``` If chunks doesn't zero out with __GFP_ZERO, it may point to somewhere else, e.g., ``` Una

Re: [PATCH] radeon: use kvcalloc for relocs and chunks

2021-03-17 Thread Christian König
Am 17.03.21 um 07:22 schrieb Chen Li: kvmalloc_array + __GFP_ZERO is the same with kvcalloc. As for p->chunks, it will be used in: ``` if (ib_chunk->kdata) memcpy(parser->ib.ptr, ib_chunk->kdata, ib_chunk->length_dw * 4); ``` If chunks doesn't zero out with __GFP_ZERO, it may p