aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2015-09-23 10:59:28 +0000
committerAlex Deucher <[email protected]>2015-09-23 21:23:43 +0000
commit1d263474c4416efb6d0feca98fe6d462b0d28f56 (patch)
tree7853d95fdbadc7427fa9e5ae40ae1145db30c847 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parentdrm/amdgpu: Fix max_vblank_count value for current display engines (diff)
downloadkernel-1d263474c4416efb6d0feca98fe6d462b0d28f56.tar.gz
kernel-1d263474c4416efb6d0feca98fe6d462b0d28f56.zip
drm/amdgpu: unwind properly in amdgpu_cs_parser_init()
The amdgpu_cs_parser_init() function doesn't clean up after itself but instead the caller uses a free everything function amdgpu_cs_parser_fini() on failure. This style of error handling is often buggy. In this example, we call "drm_free_large(parser->chunks[i].kdata);" when it is an unintialized pointer or when "parser->chunks" is NULL. I fixed this bug by adding unwind code so that it frees everything that it allocates. I also mode some other very minor changes: 1) Renamed "r" to "ret". 2) Moved the chunk_array allocation to the start of the function. 3) Removed some initializers which are no longer needed. Reviewed-by: Christian König <[email protected]> Reported-by: Ilja Van Sprundel <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
0 files changed, 0 insertions, 0 deletions