]> Git Repo - linux.git/commitdiff
vdpa: handle irq bypass register failure case
authorZhu Lingshan <[email protected]>
Fri, 23 Oct 2020 10:40:46 +0000 (18:40 +0800)
committerMichael S. Tsirkin <[email protected]>
Fri, 30 Oct 2020 08:02:53 +0000 (04:02 -0400)
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 <[email protected]>
Reported-by: kernel test robot <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
drivers/vhost/vdpa.c

index ec223da70a73f907d3782abd8fa127cf012dc249..2754f3069738027965adcf1716009007d77f8abf 100644 (file)
@@ -104,6 +104,9 @@ static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, u16 qid)
        vq->call_ctx.producer.token = vq->call_ctx.ctx;
        vq->call_ctx.producer.irq = irq;
        ret = irq_bypass_register_producer(&vq->call_ctx.producer);
+       if (unlikely(ret))
+               dev_info(&v->dev, "vq %u, irq bypass producer (token %p) registration fails, ret =  %d\n",
+                        qid, vq->call_ctx.producer.token, ret);
 }
 
 static void vhost_vdpa_unsetup_vq_irq(struct vhost_vdpa *v, u16 qid)
This page took 0.054395 seconds and 4 git commands to generate.