[Intel-gfx] [PATCH] drm/i915/gt: Fixing the error handling of shmem_pin_map
Ramalingam C
ramalingam.c at intel.com
Mon Dec 7 10:28:12 UTC 2020
Since i was size_t, at error handling if i is 0, then --i >= 0.
Making i as int.
Signed-off-by: Ramalingam C <ramalingam.c at intel.com>
cc: Chris Wilson <chris at chris-wilson.co.uk>
---
drivers/gpu/drm/i915/gt/shmem_utils.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c
index 463af675fadd..7de5bd15265c 100644
--- a/drivers/gpu/drm/i915/gt/shmem_utils.c
+++ b/drivers/gpu/drm/i915/gt/shmem_utils.c
@@ -52,8 +52,9 @@ struct file *shmem_create_from_object(struct drm_i915_gem_object *obj)
void *shmem_pin_map(struct file *file)
{
struct page **pages;
- size_t n_pages, i;
+ size_t n_pages;
void *vaddr;
+ int i;
n_pages = file->f_mapping->host->i_size >> PAGE_SHIFT;
pages = kvmalloc_array(n_pages, sizeof(*pages), GFP_KERNEL);
--
2.20.1
More information about the Intel-gfx
mailing list