diff options
author | Oded Gabbay <oded.gabbay@amd.com> | 2014-12-04 15:09:02 +0300 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@amd.com> | 2014-12-04 15:09:02 +0300 |
commit | a550bb3d5313c3d894cac552e13037394ac78fd4 (patch) | |
tree | 18822bf706a658efa77bc300625c3691ecd83cc0 /drivers/gpu/drm/amd | |
parent | c448a142a714b4ad25ebd4c872b7c9752e428c88 (diff) | |
download | linux-a550bb3d5313c3d894cac552e13037394ac78fd4.tar.xz |
amdkfd: Set *buffer_ptr to NULL in case of error
In function acquire_packet_buffer() we may return -ENOMEM. In that case, we
should set the *buffer_ptr to NULL, so that calling functions which check the
*buffer_ptr value as a criteria for success, will know that
acquire_packet_buffer() failed.
Reviewed-by: Alexey Skidanov <alexey.skidanov@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c index 9abac48de499..935071410724 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c @@ -221,8 +221,14 @@ static int acquire_packet_buffer(struct kernel_queue *kq, queue_size_dwords; if (packet_size_in_dwords >= queue_size_dwords || - packet_size_in_dwords >= available_size) + packet_size_in_dwords >= available_size) { + /* + * make sure calling functions know + * acquire_packet_buffer() failed + */ + *buffer_ptr = NULL; return -ENOMEM; + } if (wptr + packet_size_in_dwords >= queue_size_dwords) { while (wptr > 0) { |