public inbox for iommu@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: [bug report] iommu/amd: Use is_attach_deferred call-back
Date: Thu, 24 Aug 2017 14:04:06 +0300	[thread overview]
Message-ID: <20170824110406.vm4yqalngig4seep@mwanda> (raw)

Hello Baoquan He,

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

The patch df3f7a6e8e85: "iommu/amd: Use is_attach_deferred call-back" 
from Aug 9, 2017, leads to the following Smatch complaint:

drivers/iommu/amd_iommu.c:2265 get_domain()
	 error: we previously assumed 'domain' could be null (see line 2259)

drivers/iommu/amd_iommu.c
  2258		domain = get_dev_data(dev)->domain;
  2259		if (domain == NULL && get_dev_data(dev)->defer_attach) {
                    ^^^^^^^^^^^^^^
The patch adds a new check for NULL.

  2260			get_dev_data(dev)->defer_attach = false;
  2261			io_domain = iommu_get_domain_for_dev(dev);
  2262			domain = to_pdomain(io_domain);
  2263			attach_device(dev, domain);
  2264		}
  2265		if (!dma_ops_domain(domain))
                                    ^^^^^^
Existing unchecked dereference inside the function.

  2266			return ERR_PTR(-EBUSY);
  2267	

regards,
dan carpenter

             reply	other threads:[~2017-08-24 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24 11:04 Dan Carpenter [this message]
2017-08-24 11:55 ` [bug report] iommu/amd: Use is_attach_deferred call-back Baoquan He

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=20170824110406.vm4yqalngig4seep@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    /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