Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Jing Zhang <jingzhangos@google.com>
Cc: kvmarm@lists.linux.dev
Subject: [bug report] KVM: arm64: vgic-its: Add debugfs interface to expose ITS tables
Date: Fri, 23 May 2025 16:05:24 +0300	[thread overview]
Message-ID: <aDBylI1YnjPatAbr@stanley.mountain> (raw)

Hello Jing Zhang,

This is a semi-automatic email about new static checker warnings.

Commit 30deb51a677b ("KVM: arm64: vgic-its: Add debugfs interface to
expose ITS tables") from Feb 20, 2025, leads to the following Smatch
complaint:

    arch/arm64/kvm/vgic/vgic-debug.c:501 vgic_its_debug_show()
    warn: variable dereferenced before check 'ite' (see line 493)

arch/arm64/kvm/vgic/vgic-debug.c
   492	
   493		if (list_is_first(&ite->ite_list, &dev->itt_head)) {
                                   ^^^^^^^^^^^^^
This dereferences "ite"

   494			seq_printf(s, "\n");
   495			seq_printf(s, "Device ID: 0x%x, Event ID Range: [0 - %llu]\n",
   496				   dev->device_id, BIT_ULL(dev->num_eventid_bits) - 1);
   497			seq_printf(s, "EVENT_ID    INTID  HWINTID   TARGET   COL_ID HW\n");
   498			seq_printf(s, "-----------------------------------------------\n");
   499		}
   500	
   501		if (ite && ite->irq && ite->collection) {
                    ^^^
So this check is too late.

   502			seq_printf(s, "%8u %8u %8u %8u %8u %2d\n",
   503				   ite->event_id, ite->irq->intid, ite->irq->hwintid,

regards,
dan carpenter

             reply	other threads:[~2025-05-23 13:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23 13:05 Dan Carpenter [this message]
2025-05-29 13:01 ` [bug report] KVM: arm64: vgic-its: Add debugfs interface to expose ITS tables Zenghui Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aDBylI1YnjPatAbr@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=jingzhangos@google.com \
    --cc=kvmarm@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox