aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c8
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,
221 queue_size_dwords; 221 queue_size_dwords;
222 222
223 if (packet_size_in_dwords >= queue_size_dwords || 223 if (packet_size_in_dwords >= queue_size_dwords ||
224 packet_size_in_dwords >= available_size) 224 packet_size_in_dwords >= available_size) {
225 /*
226 * make sure calling functions know
227 * acquire_packet_buffer() failed
228 */
229 *buffer_ptr = NULL;
225 return -ENOMEM; 230 return -ENOMEM;
231 }
226 232
227 if (wptr + packet_size_in_dwords >= queue_size_dwords) { 233 if (wptr + packet_size_in_dwords >= queue_size_dwords) {
228 while (wptr > 0) { 234 while (wptr > 0) {