linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vDPA/ifcvf: match pointer check to use
@ 2022-03-15 12:41 trix
  2022-03-15 13:23 ` Michael S. Tsirkin
  2022-03-15 13:28 ` Michael S. Tsirkin
  0 siblings, 2 replies; 6+ messages in thread
From: trix @ 2022-03-15 12:41 UTC (permalink / raw)
  To: mst, jasowang, nathan, ndesaulniers, lingshan.zhu, sgarzare, xieyongji
  Cc: virtualization, linux-kernel, llvm, Tom Rix

From: Tom Rix <trix@redhat.com>

Clang static analysis reports this issue
ifcvf_main.c:49:4: warning: Called function
  pointer is null (null dereference)
  vf->vring->cb.callback(vring->cb.private);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The check
  vring = &vf->vring[i];
  if (vring->cb.callback)

Does not match the use.  Change dereference so they match.

Fixes: 79333575b8bd ("vDPA/ifcvf: implement shared IRQ feature")
Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/vdpa/ifcvf/ifcvf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
index 3b48e717e89f7..4366320fb68d3 100644
--- a/drivers/vdpa/ifcvf/ifcvf_main.c
+++ b/drivers/vdpa/ifcvf/ifcvf_main.c
@@ -46,7 +46,7 @@ static irqreturn_t ifcvf_vqs_reused_intr_handler(int irq, void *arg)
 	for (i = 0; i < vf->nr_vring; i++) {
 		vring = &vf->vring[i];
 		if (vring->cb.callback)
-			vf->vring->cb.callback(vring->cb.private);
+			vring->cb.callback(vring->cb.private);
 	}
 
 	return IRQ_HANDLED;
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-16  2:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-15 12:41 [PATCH] vDPA/ifcvf: match pointer check to use trix
2022-03-15 13:23 ` Michael S. Tsirkin
2022-03-15 13:28 ` Michael S. Tsirkin
2022-03-15 15:03   ` Tom Rix
2022-03-15 15:15     ` Michael S. Tsirkin
2022-03-16  2:25       ` Zhu, Lingshan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).