Skip to content

Commit e01afe3

Browse files
Zhu Lingshanmstsirkin
authored andcommitted
vdpa: handle irq bypass register failure case
LKP considered variable 'ret' in vhost_vdpa_setup_vq_irq() as a unused variable, so suggest we remove it. Actually it stores return value of irq_bypass_register_producer(), but we did not check it, we should handle the failure case. This commit will print a message if irq bypass register producer fail, in this case, vqs still remain functional. Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com> Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/20201023104046.404794-1-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
1 parent 1eca16b commit e01afe3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/vhost/vdpa.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, u16 qid)
104104
vq->call_ctx.producer.token = vq->call_ctx.ctx;
105105
vq->call_ctx.producer.irq = irq;
106106
ret = irq_bypass_register_producer(&vq->call_ctx.producer);
107+
if (unlikely(ret))
108+
dev_info(&v->dev, "vq %u, irq bypass producer (token %p) registration fails, ret = %d\n",
109+
qid, vq->call_ctx.producer.token, ret);
107110
}
108111

109112
static void vhost_vdpa_unsetup_vq_irq(struct vhost_vdpa *v, u16 qid)

0 commit comments

Comments
 (0)