staging: iio: Use kcalloc instead of kzalloc to allocate array
[firefly-linux-kernel-4.4.55.git] / drivers / staging / iio / iio_simple_dummy.c
index 228f991d40ecc296137483c697db21d3ee38dadd..e3a94572bb40e27296530b5d3b4d789e47095a14 100644 (file)
@@ -518,7 +518,8 @@ static __init int iio_dummy_init(void)
                return -EINVAL;
        }
        /* Fake a bus */
-       iio_dummy_devs = kzalloc(sizeof(*iio_dummy_devs)*instances, GFP_KERNEL);
+       iio_dummy_devs = kcalloc(instances, sizeof(*iio_dummy_devs),
+                                GFP_KERNEL);
        /* Here we have no actual device so call probe */
        for (i = 0; i < instances; i++) {
                ret = iio_dummy_probe(i);