All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: suravee.suthikulpanit@amd.com
Cc: iommu@lists.linux-foundation.org
Subject: [bug report] iommu/amd: Restore IRTE.RemapEn bit after programming IRTE
Date: Wed, 9 Sep 2020 14:46:38 +0300	[thread overview]
Message-ID: <20200909114638.GA17539@mwanda> (raw)

Hello Suravee Suthikulpanit,

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

The patch 26e495f34107: "iommu/amd: Restore IRTE.RemapEn bit after
programming IRTE" from Sep 3, 2020, leads to the following Smatch
complaint:

    drivers/iommu/amd/iommu.c:3870 amd_iommu_deactivate_guest_mode()
    warn: variable dereferenced before check 'entry' (see line 3867)

drivers/iommu/amd/iommu.c
  3866		struct irq_cfg *cfg = ir_data->cfg;
  3867		u64 valid = entry->lo.fields_remap.valid;
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The patch adds a new dereference

  3868	
  3869		if (!AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir) ||
  3870		    !entry || !entry->lo.fields_vapic.guest_mode)
                    ^^^^^^
before "entry" has been checked for NULL.

  3871			return 0;
  3872	

regards,
dan carpenter
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

                 reply	other threads:[~2020-09-09 11:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200909114638.GA17539@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=suravee.suthikulpanit@amd.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.