diff mbox series

drm/i915: unmap the correct pointer in i915_error_object_create()

Message ID 20191126125003.zpczouqpyr7njwha@kili.mountain (mailing list archive)
State New, archived
Headers show
Series drm/i915: unmap the correct pointer in i915_error_object_create() | expand

Commit Message

Dan Carpenter Nov. 26, 2019, 12:50 p.m. UTC
We should be unmapping "page" instead of "s".  This code originally used
kmap_atomic() before it was changed to kmap().  The two mapping
functions are different which leads to this common mistake.

Fixes: 3e749f5199e1 ("drm/i915: Avoid atomic context for error capture")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/i915_gpu_error.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chris Wilson Nov. 26, 2019, 12:52 p.m. UTC | #1
Quoting Dan Carpenter (2019-11-26 12:50:03)
> We should be unmapping "page" instead of "s".  This code originally used
> kmap_atomic() before it was changed to kmap().  The two mapping
> functions are different which leads to this common mistake.
> 
> Fixes: 3e749f5199e1 ("drm/i915: Avoid atomic context for error capture")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Caught by bae21dacd7b7 ("drm/i915: Switch kunmap() to take the page not
vaddr")

Thanks for smatch!
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 3c85cb0ee99f..6fe23446303b 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -1045,7 +1045,7 @@  i915_error_object_create(struct drm_i915_private *i915,
 
 			s = kmap(page);
 			ret = compress_page(compress, s, dst);
-			kunmap(s);
+			kunmap(page);
 
 			drm_clflush_pages(&page, 1);