]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/dma/ipu/ipu_idmac.c
treewide: Use array_size() in vmalloc()
[linux.git] / drivers / dma / ipu / ipu_idmac.c
index ed76044ce4b92a41bccfd0169df7df66b58841ca..bbff52be4f0ff1a83bb04e12f278fda864411b08 100644 (file)
@@ -910,7 +910,8 @@ static dma_cookie_t idmac_tx_submit(struct dma_async_tx_descriptor *tx)
 /* Called with ichan->chan_mutex held */
 static int idmac_desc_alloc(struct idmac_channel *ichan, int n)
 {
-       struct idmac_tx_desc *desc = vmalloc(n * sizeof(struct idmac_tx_desc));
+       struct idmac_tx_desc *desc =
+               vmalloc(array_size(n, sizeof(struct idmac_tx_desc)));
        struct idmac *idmac = to_idmac(ichan->dma_chan.device);
 
        if (!desc)