Merge tag 'dmaengine-4.18-rc1' of git://git.infradead.org/users/vkoul/slave-dma
[platform/kernel/linux-rpi.git] / drivers / dma / sprd-dma.c
index ab69f83..55df0d4 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;