treewide: kmalloc() -> kmalloc_array()
[sfrench/cifs-2.6.git] / sound / core / pcm_native.c
index 04c6301394d053ce5751ae33087c080cddd59b71..cecc79772c947ecde8237e199b6043eb39e38e44 100644 (file)
@@ -3072,7 +3072,7 @@ static ssize_t snd_pcm_readv(struct kiocb *iocb, struct iov_iter *to)
        if (!frame_aligned(runtime, to->iov->iov_len))
                return -EINVAL;
        frames = bytes_to_samples(runtime, to->iov->iov_len);
-       bufs = kmalloc(sizeof(void *) * to->nr_segs, GFP_KERNEL);
+       bufs = kmalloc_array(to->nr_segs, sizeof(void *), GFP_KERNEL);
        if (bufs == NULL)
                return -ENOMEM;
        for (i = 0; i < to->nr_segs; ++i)
@@ -3107,7 +3107,7 @@ static ssize_t snd_pcm_writev(struct kiocb *iocb, struct iov_iter *from)
            !frame_aligned(runtime, from->iov->iov_len))
                return -EINVAL;
        frames = bytes_to_samples(runtime, from->iov->iov_len);
-       bufs = kmalloc(sizeof(void *) * from->nr_segs, GFP_KERNEL);
+       bufs = kmalloc_array(from->nr_segs, sizeof(void *), GFP_KERNEL);
        if (bufs == NULL)
                return -ENOMEM;
        for (i = 0; i < from->nr_segs; ++i)