Merge tag 'dmaengine-4.18-rc1' of git://git.infradead.org/users/vkoul/slave-dma
[muen/linux.git] / drivers / dma / ti / omap-dma.c
index b73fb51fbc81b5df080925c8e9853e935afe8288..9b5ca8691f27dcf6561fbd98051b697ab2da6011 100644 (file)
@@ -917,7 +917,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
        }
 
        /* Now allocate and setup the descriptor. */
-       d = kzalloc(sizeof(*d) + sglen * sizeof(d->sg[0]), GFP_ATOMIC);
+       d = kzalloc(struct_size(d, sg, sglen), GFP_ATOMIC);
        if (!d)
                return NULL;