]> git.baikalelectronics.ru Git - kernel.git/commit
mm/gup_benchmark: fix unsigned comparison to zero in __gup_benchmark_ioctl
authorYueHaibing <yuehaibing@huawei.com>
Fri, 5 Oct 2018 22:51:44 +0000 (15:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Oct 2018 23:32:04 +0000 (16:32 -0700)
commit854a593b3396f2b4f896a530b1b854c3dd42f0ff
tree7db76ed2366fceaa24eb69e4ff38319588f0751a
parent7f519e46d94d6168a2a431445f65e8b24eddf4b9
mm/gup_benchmark: fix unsigned comparison to zero in __gup_benchmark_ioctl

get_user_pages_fast() will return negative value if no pages were pinned,
then be converted to a unsigned, which is compared to zero, giving the
wrong result.

Link: http://lkml.kernel.org/r/20180921095015.26088-1-yuehaibing@huawei.com
Fixes: 80b628fe7d75 ("mm/gup_benchmark: handle gup failures")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/gup_benchmark.c