Skip to content

Commit 7c77474

Browse files
jbeulichjgross1
authored andcommitted
xen-scsiback: don't "handle" error by BUG()
In particular -ENOMEM may come back here, from set_foreign_p2m_mapping(). Don't make problems worse, the more that handling elsewhere (together with map's status fields now indicating whether a mapping wasn't even attempted, and hence has to be considered failed) doesn't require this odd way of dealing with errors. This is part of XSA-362. Signed-off-by: Jan Beulich <jbeulich@suse.com> Cc: stable@vger.kernel.org Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent 3194a17 commit 7c77474

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/xen/xen-scsiback.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,12 @@ static int scsiback_gnttab_data_map_batch(struct gnttab_map_grant_ref *map,
386386
return 0;
387387

388388
err = gnttab_map_refs(map, NULL, pg, cnt);
389-
BUG_ON(err);
390389
for (i = 0; i < cnt; i++) {
391390
if (unlikely(map[i].status != GNTST_okay)) {
392391
pr_err("invalid buffer -- could not remap it\n");
393392
map[i].handle = SCSIBACK_INVALID_HANDLE;
394-
err = -ENOMEM;
393+
if (!err)
394+
err = -ENOMEM;
395395
} else {
396396
get_page(pg[i]);
397397
}

0 commit comments

Comments
 (0)