From 64eb0fdb389ec76a5bda59e76861d6a1e6d4af9e Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 10 Jun 2022 01:19:27 +0000 Subject: [PATCH] drm/amdgpu/cs: make commands with 0 chunks illegal behaviour. From Dave Airlie 70276460e914d560e96bfc208695a872fe9469c9 in linux 5.15.y/5.15.46 31ab27b14daaa75541a415c6794d6f3567fea44a in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c index 9a8b2548a9f..a0eaadd3645 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_cs.c @@ -115,7 +115,7 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, union drm_amdgpu_cs int ret; if (cs->in.num_chunks == 0) - return 0; + return -EINVAL; chunk_array = kvmalloc_array(cs->in.num_chunks, sizeof(uint64_t), GFP_KERNEL); if (!chunk_array) -- 2.20.1