[PATCH] drm/i915/selftests: fix an error code in copy()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Return the error code if i915_gem_object_create_internal() fails,
instead of returning success.

Fixes: cf586021642d ("drm/i915/gt: Pipelined page migration")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
 drivers/gpu/drm/i915/gt/selftest_migrate.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/selftest_migrate.c b/drivers/gpu/drm/i915/gt/selftest_migrate.c
index e677f2da093d..a26429fd5326 100644
--- a/drivers/gpu/drm/i915/gt/selftest_migrate.c
+++ b/drivers/gpu/drm/i915/gt/selftest_migrate.c
@@ -55,8 +55,10 @@ static int copy(struct intel_migrate *migrate,
 
 	sz = src->base.size;
 	dst = i915_gem_object_create_internal(i915, sz);
-	if (IS_ERR(dst))
+	if (IS_ERR(dst)) {
+		err = PTR_ERR(dst);
 		goto err_free_src;
+	}
 
 	for_i915_gem_ww(&ww, err, true) {
 		err = i915_gem_object_lock(src, &ww);
-- 
2.39.2




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux