Skip to content

Commit 1ab134c

Browse files
Dan CarpenterBoris Ostrovsky
authored andcommitted
xen/pvcalls: Fix a check in pvcalls_front_remove()
bedata->ref can't be less than zero because it's unsigned. This affects certain error paths in probe. We first set ->ref = -1 and then we set it to a valid value later. Fixes: 2196819 ("xen/pvcalls: connect to the backend") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Juergen Gross <jgross@suse.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
1 parent 8c71fa8 commit 1ab134c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/xen/pvcalls-front.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ static int pvcalls_front_remove(struct xenbus_device *dev)
11031103
kfree(map);
11041104
}
11051105
}
1106-
if (bedata->ref >= 0)
1106+
if (bedata->ref != -1)
11071107
gnttab_end_foreign_access(bedata->ref, 0, 0);
11081108
kfree(bedata->ring.sring);
11091109
kfree(bedata);

0 commit comments

Comments
 (0)