]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
xen-gntalloc: signedness bug in add_grefs()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 4 Nov 2011 18:24:36 +0000 (21:24 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 21 Nov 2011 22:31:24 +0000 (14:31 -0800)
commit015be9f48be43814f14326555e9ea576cf0343d7
tree5ecd22e5ad13b57b7120567a517b4fc0f665b458
parent2c59105ba0af5df97d9b614c999553f79d6ece67
xen-gntalloc: signedness bug in add_grefs()

commit 99cb2ddcc617f43917e94a4147aa3ccdb2bcd77e upstream.

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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/xen/gntalloc.c