xen-gntalloc: signedness bug in add_grefs()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 4 Nov 2011 18:24:36 +0000 (21:24 +0300)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 16 Nov 2011 17:13:48 +0000 (12:13 -0500)
commit99cb2ddcc617f43917e94a4147aa3ccdb2bcd77e
tree2c2f3a0271dc0e2b627eb45823c03a10bbce3002
parent21643e69a4c06f7ef155fbc70e3fba13fba4a756
xen-gntalloc: signedness bug in add_grefs()

gref->gref_id is unsigned so the error handling didn't work.
gnttab_grant_foreign_access() returns an int type, so we can add a
cast here, and it doesn't cause any problems.
gnttab_grant_foreign_access() can return a variety of errors
including -ENOSPC, -ENOSYS and -ENOMEM.

CC: stable@kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/gntalloc.c