drm/amdgpu: check memory allocation failure
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 23 Aug 2017 05:52:36 +0000 (07:52 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 24 Aug 2017 18:27:43 +0000 (14:27 -0400)
commita1d6b1901a2154e9f44f39738491f0afc3f8608e
tree86d93d568fbc2be69550ef3e0aa8a43dc1c54a78
parent2959a5346b8943412226c4b51c78f9b6f077c2a0
drm/amdgpu: check memory allocation failure

Check memory allocation failure and return -ENOMEM in such a case.

'num_post_dep_syncobjs' still has to be set to 0 before the test in order
to have it initialized if 'amdgpu_cs_parser_fini()' is called to free
resources.

The calling graph would be, in such a case!
   failure in amdgpu_cs_process_syncobj_out_dep()
      ---> error code returned by amdgpu_cs_dependencies()
         --> amdgpu_cs_parser_fini() is called

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c