nouveau/svm: Use kvcalloc() instead of kvzalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 28 Sep 2021 22:25:13 +0000 (17:25 -0500)
committerGustavo A. R. Silva <gustavoars@kernel.org>
Thu, 28 Oct 2021 17:41:09 +0000 (12:41 -0500)
Use 2-factor argument form kvcalloc() instead of kvzalloc().

Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
drivers/gpu/drm/nouveau/nouveau_svm.c

index b0c3422..1a896a2 100644 (file)
@@ -992,7 +992,7 @@ nouveau_svm_fault_buffer_ctor(struct nouveau_svm *svm, s32 oclass, int id)
        if (ret)
                return ret;
 
-       buffer->fault = kvzalloc(sizeof(*buffer->fault) * buffer->entries, GFP_KERNEL);
+       buffer->fault = kvcalloc(sizeof(*buffer->fault), buffer->entries, GFP_KERNEL);
        if (!buffer->fault)
                return -ENOMEM;