drm: shmem: Off by one in drm_gem_shmem_fault()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 22 Mar 2019 06:41:25 +0000 (09:41 +0300)
committerEric Anholt <eric@anholt.net>
Mon, 1 Apr 2019 17:44:34 +0000 (10:44 -0700)
commit3a3fe6e766630aacf8cc212cceb1d57d7b346463
tree7d2c934ec39fc4d8ea86b7feb470af71b429374b
parent3051719af11eb48dc8947826cfb66dbe0f281c7d
drm: shmem: Off by one in drm_gem_shmem_fault()

The shmem->pages[] array has "num_pages" elements so the > should be >=
to prevent reading beyond the end of the array.  The shmem->pages[]
array is allocated in drm_gem_shmem_prime_import_sg_table().

Fixes: 2194a63a818d ("drm: Add library for shmem backed GEM objects")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190322064125.GA12551@kadam
drivers/gpu/drm/drm_gem_shmem_helper.c