public inbox for amd-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Emily Deng <Emily.Deng-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Emily Deng <Emily.Deng-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH libdrm] amdgpu: When couldn't find bo, need to return error.
Date: Sat, 1 Sep 2018 12:24:23 +0800	[thread overview]
Message-ID: <1535775863-27689-1-git-send-email-Emily.Deng@amd.com> (raw)

The startx will have segmant fault if return success.

SWDEV-163962

Change-Id: I56b189fa26efdcd1d96e5100af3f3e0b1208b0c3
Signed-off-by: Emily Deng <Emily.Deng@amd.com>
---
 amdgpu/amdgpu_bo.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
index f25cacc..7e297fa 100644
--- a/amdgpu/amdgpu_bo.c
+++ b/amdgpu/amdgpu_bo.c
@@ -760,6 +760,7 @@ int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
 				  uint64_t *offset_in_bo)
 {
 	uint32_t i;
+	int r = 0;
 	struct amdgpu_bo *bo;
 
 	if (cpu == NULL || size == 0)
@@ -787,10 +788,11 @@ int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
 	} else {
 		*buf_handle = NULL;
 		*offset_in_bo = 0;
+		r = -errno;
 	}
 	pthread_mutex_unlock(&dev->bo_table_mutex);
 
-	return 0;
+	return r;
 }
 
 int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev,
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

             reply	other threads:[~2018-09-01  4:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-01  4:24 Emily Deng [this message]
     [not found] ` <1535775863-27689-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org>
2018-09-01  8:17   ` [PATCH libdrm] amdgpu: When couldn't find bo, need to return error Christian König
     [not found]     ` <aabe391a-d6d5-564f-1e0d-b2fb218bdeae-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-01  8:58       ` Deng, Emily
     [not found]         ` <DM6PR12MB265273E1B06F0AB7A3B32A4D8F0E0-lmeGfMZKVrHiBFXSrFbU1AdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-03  1:42           ` Zhang, Jerry (Junwei)
     [not found]             ` <5B8C9169.4000909-5C7GfCeVMHo@public.gmane.org>
2018-09-03  7:11               ` Christian König
     [not found]                 ` <48942a46-474b-a120-5b61-2fcbaf3eae4b-5C7GfCeVMHo@public.gmane.org>
2018-09-03  7:16                   ` Zhang, Jerry (Junwei)
     [not found]                     ` <5B8CDFDF.2030703-5C7GfCeVMHo@public.gmane.org>
2018-09-03  8:44                       ` Christian König
     [not found]                         ` <a55accb0-95d9-c25e-05dd-65a6a736c379-5C7GfCeVMHo@public.gmane.org>
2018-09-03  9:08                           ` Zhang, Jerry (Junwei)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1535775863-27689-1-git-send-email-Emily.Deng@amd.com \
    --to=emily.deng-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox