Merge tag 'dmaengine-4.18-rc1' of git://git.infradead.org/users/vkoul/slave-dma
[linux-2.6-microblaze.git] / drivers / dma / ti / omap-dma.c
index b73fb51..9b5ca86 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;