Unverified Commit 4da80f1b authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!6623 amdkfd: use calloc instead of kzalloc to avoid integer overflow

parents 2156b7a9 5674dade
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -959,8 +959,8 @@ static int kfd_ioctl_get_process_apertures_new(struct file *filp,
	 * nodes, but not more than args->num_of_nodes as that is
	 * the amount of memory allocated by user
	 */
	pa = kzalloc((sizeof(struct kfd_process_device_apertures) *
				args->num_of_nodes), GFP_KERNEL);
	pa = kcalloc(args->num_of_nodes, sizeof(struct kfd_process_device_apertures),
		     GFP_KERNEL);
	if (!pa)
		return -ENOMEM;