drm/amdgpu/cs: make commands with 0 chunks illegal behaviour.
authorjsg <jsg@openbsd.org>
Fri, 10 Jun 2022 01:19:27 +0000 (01:19 +0000)
committerjsg <jsg@openbsd.org>
Fri, 10 Jun 2022 01:19:27 +0000 (01:19 +0000)
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

index 9a8b254..a0eaadd 100644 (file)
@@ -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)