Commit 82e1b93a authored by Christian König's avatar Christian König
Browse files

dma-buf: use struct_size macro



Instead of manually calculating the structure size.

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/394252/
parent 1a11a88c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;