diff options
Diffstat (limited to 'drivers/xen/gntalloc.c')
-rw-r--r-- | drivers/xen/gntalloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c index f6832f46aea4..e1c4c6e5b469 100644 --- a/drivers/xen/gntalloc.c +++ b/drivers/xen/gntalloc.c | |||
@@ -135,7 +135,7 @@ static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, | |||
135 | /* Grant foreign access to the page. */ | 135 | /* Grant foreign access to the page. */ |
136 | gref->gref_id = gnttab_grant_foreign_access(op->domid, | 136 | gref->gref_id = gnttab_grant_foreign_access(op->domid, |
137 | pfn_to_mfn(page_to_pfn(gref->page)), readonly); | 137 | pfn_to_mfn(page_to_pfn(gref->page)), readonly); |
138 | if (gref->gref_id < 0) { | 138 | if ((int)gref->gref_id < 0) { |
139 | rc = gref->gref_id; | 139 | rc = gref->gref_id; |
140 | goto undo; | 140 | goto undo; |
141 | } | 141 | } |
@@ -280,7 +280,7 @@ static long gntalloc_ioctl_alloc(struct gntalloc_file_private_data *priv, | |||
280 | goto out; | 280 | goto out; |
281 | } | 281 | } |
282 | 282 | ||
283 | gref_ids = kzalloc(sizeof(gref_ids[0]) * op.count, GFP_TEMPORARY); | 283 | gref_ids = kcalloc(op.count, sizeof(gref_ids[0]), GFP_TEMPORARY); |
284 | if (!gref_ids) { | 284 | if (!gref_ids) { |
285 | rc = -ENOMEM; | 285 | rc = -ENOMEM; |
286 | goto out; | 286 | goto out; |