mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
dma-buf: use struct_size macro
Instead of manually calculating the structure size. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/394252/
This commit is contained in:
parent
1a11a88cfd
commit
82e1b93ad8
1 changed files with 1 additions and 1 deletions
|
@ -63,7 +63,7 @@ static struct dma_resv_list *dma_resv_list_alloc(unsigned int shared_max)
|
|||
{
|
||||
struct dma_resv_list *list;
|
||||
|
||||
list = kmalloc(offsetof(typeof(*list), shared[shared_max]), GFP_KERNEL);
|
||||
list = kmalloc(struct_size(list, shared, shared_max), GFP_KERNEL);
|
||||
if (!list)
|
||||
return NULL;
|
||||
|
||||
|
|
Loading…
Reference in a new issue