Merge tag 'dmaengine-4.18-rc1' of git://git.infradead.org/users/vkoul/slave-dma
[muen/linux.git] / drivers / dma / sprd-dma.c
index ab69f835ea024cd9feaa19400a3357a79b001130..55df0d41355b0622f4fb9ede60fd6bddbfe5a4e6 100644 (file)
@@ -861,8 +861,8 @@ static int sprd_dma_probe(struct platform_device *pdev)
                return ret;
        }
 
-       sdev = devm_kzalloc(&pdev->dev, sizeof(*sdev) +
-                           sizeof(*dma_chn) * chn_count,
+       sdev = devm_kzalloc(&pdev->dev,
+                           struct_size(sdev, channels, chn_count),
                            GFP_KERNEL);
        if (!sdev)
                return -ENOMEM;