Skip to contentSkip to conversation

drm/i915: Check the correct variable

PATCH In review Dan Carpenter 4 participants 5 messages Dec 3, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Check the correct variable

There is a copy and paste bug in this code. It's supposed to check "obj2" instead of checking "obj" a second time.

Fixes 80f0b679d6f0 ("drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2.")
---
 drivers/gpu/drm/i915/selftests/i915_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/selftests/i915_gem.c +2 -2
index 23a6132c5f4e..412e21604a05 100644
@@ -211,8 +211,8 @@ static int igt_gem_ww_ctx(void *arg)
 		return PTR_ERR(obj);
 
 	obj2 = i915_gem_object_create_internal(i915, PAGE_SIZE);
-	if (IS_ERR(obj)) {
-		err = PTR_ERR(obj);
+	if (IS_ERR(obj2)) {
+		err = PTR_ERR(obj2);
 		goto put1;
 	}
 
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw

Quoting Dan Carpenter (2020-12-03 08:45:17)

Quoted 14 lines

There is a copy and paste bug in this code. It's supposed to check "obj2" instead of checking "obj" a second time.

Fixes 80f0b679d6f0 ("drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2.")
---
 drivers/gpu/drm/i915/selftests/i915_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/selftests/i915_gem.c +0 -0
index 23a6132c5f4e..412e21604a05 100644

drivers/gpu/drm/i915/selftests/i915_gem.c static int igt_gem_ww_ctx(void *arg) · line 215

Quoted 7 lines
drivers/gpu/drm/i915/selftests/i915_gem.c +2 -2
@@ -211,8 +211,8 @@ static int igt_gem_ww_ctx(void *arg)
                return PTR_ERR(obj);
 
        obj2 = i915_gem_object_create_internal(i915, PAGE_SIZE);
-       if (IS_ERR(obj)) {
-               err = PTR_ERR(obj);
+       if (IS_ERR(obj2)) {
+               err = PTR_ERR(obj2);

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter

Hi Dan,

Quoted 14 lines

There is a copy and paste bug in this code. It's supposed to check "obj2" instead of checking "obj" a second time.

Fixes 80f0b679d6f0 ("drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2.")
---
 drivers/gpu/drm/i915/selftests/i915_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/selftests/i915_gem.c +0 -0
index 23a6132c5f4e..412e21604a05 100644

drivers/gpu/drm/i915/selftests/i915_gem.c static int igt_gem_ww_ctx(void *arg) · line 215

Quoted 7 lines
drivers/gpu/drm/i915/selftests/i915_gem.c +2 -2
@@ -211,8 +211,8 @@ static int igt_gem_ww_ctx(void *arg)
 		return PTR_ERR(obj);
 
 	obj2 = i915_gem_object_create_internal(i915, PAGE_SIZE);
-	if (IS_ERR(obj)) {
-		err = PTR_ERR(obj);
+	if (IS_ERR(obj2)) {
+		err = PTR_ERR(obj2);

Thanks,
Andi

#3 lore raw

Quoting Andi Shyti (2020-12-03 11:12:24)

Quoted 18 lines

Hi Dan,

Quoted 16 lines

There is a copy and paste bug in this code. It's supposed to check "obj2" instead of checking "obj" a second time.

Fixes 80f0b679d6f0 ("drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2.")
---
 drivers/gpu/drm/i915/selftests/i915_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/selftests/i915_gem.c +0 -0
index 23a6132c5f4e..412e21604a05 100644
@@ -211,8 +211,8 @@ static int igt_gem_ww_ctx(void *arg)
              return PTR_ERR(obj);
 
Quoted 7 lines

drivers/gpu/drm/i915/selftests/i915_gem.c static int igt_gem_ww_ctx(void *arg) · line 215

Quoted 5 lines
drivers/gpu/drm/i915/selftests/i915_gem.c +2 -2
      obj2 = i915_gem_object_create_internal(i915, PAGE_SIZE);
-     if (IS_ERR(obj)) {
-             err = PTR_ERR(obj);
+     if (IS_ERR(obj2)) {
+             err = PTR_ERR(obj2);

I gave up waiting for patchwork to spot the original patch, and pushed.

Thanks,
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Check the correct variable

In reply to Dan Carpenter
== Series Details ==

== Series Details ==

Series: drm/i915: Check the correct variable
URL : https://patchwork.freedesktop.org/series/84534/
State : failure

== Summary ==

Applying: drm/i915: Check the correct variable
Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/selftests/i915_gem.c
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx