Commit bb70913d authored by Jing Yangyang's avatar Jing Yangyang Committed by Juergen Gross

drivers/xen/xenbus/xenbus_client.c: fix bugon.cocci warnings

Use BUG_ON instead of a if condition followed by BUG.

Generated by: scripts/coccinelle/misc/bugon.cocci
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarJing Yangyang <jing.yangyang@zte.com.cn>
Reviewed-by: default avatarSeongJae Park <sjpark@amazon.de>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20210825062451.69998-1-deng.changcheng@zte.com.cnSigned-off-by: default avatarJuergen Gross <jgross@suse.com>
parent b94e4b14
...@@ -542,8 +542,7 @@ static int __xenbus_map_ring(struct xenbus_device *dev, ...@@ -542,8 +542,7 @@ static int __xenbus_map_ring(struct xenbus_device *dev,
} }
} }
if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, info->unmap, j)) BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, info->unmap, j));
BUG();
*leaked = false; *leaked = false;
for (i = 0; i < j; i++) { for (i = 0; i < j; i++) {
...@@ -581,8 +580,7 @@ static int xenbus_unmap_ring(struct xenbus_device *dev, grant_handle_t *handles, ...@@ -581,8 +580,7 @@ static int xenbus_unmap_ring(struct xenbus_device *dev, grant_handle_t *handles,
gnttab_set_unmap_op(&unmap[i], vaddrs[i], gnttab_set_unmap_op(&unmap[i], vaddrs[i],
GNTMAP_host_map, handles[i]); GNTMAP_host_map, handles[i]);
if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap, i)) BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap, i));
BUG();
err = GNTST_okay; err = GNTST_okay;
for (i = 0; i < nr_handles; i++) { for (i = 0; i < nr_handles; i++) {
...@@ -778,8 +776,7 @@ static int xenbus_unmap_ring_pv(struct xenbus_device *dev, void *vaddr) ...@@ -778,8 +776,7 @@ static int xenbus_unmap_ring_pv(struct xenbus_device *dev, void *vaddr)
unmap[i].handle = node->handles[i]; unmap[i].handle = node->handles[i];
} }
if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap, i)) BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, unmap, i));
BUG();
err = GNTST_okay; err = GNTST_okay;
leaked = false; leaked = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment