Skip to content

Commit c82e8b2

Browse files
suijingfenglynxeye-dev
authored andcommitted
drm/etnaviv: Use 'unsigned' type to count the number of pages
The unpin_user_pages() function takes an 'unsigned long' argument to store the number of userspace pages, and the struct drm_gem_object::size is a size_t type. The number of pages can not be negative, hence, use 'unsigned' variable to count the number of pages. Reviewed-by: Christian Gmeiner <[email protected]> Signed-off-by: Sui Jingfeng <[email protected]> Signed-off-by: Lucas Stach <[email protected]>
1 parent 56257d4 commit c82e8b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ static void etnaviv_gem_userptr_release(struct etnaviv_gem_object *etnaviv_obj)
686686
kfree(etnaviv_obj->sgt);
687687
}
688688
if (etnaviv_obj->pages) {
689-
int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
689+
unsigned int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
690690

691691
unpin_user_pages(etnaviv_obj->pages, npages);
692692
kvfree(etnaviv_obj->pages);

0 commit comments

Comments
 (0)