Merge tag 'for-5.11/revert-problem-v5.10-raid-changes' of git://git.kernel.org/pub...
[linux-2.6-microblaze.git] / drivers / dma-buf / dma-resv.c
index 1c8f258..bb5a42b 100644 (file)
@@ -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;