Linux IOMMU Development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: jroedel-l3A5Bk7waGM@public.gmane.org
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: re: iommu/amd: Put IOMMUv2 devices in a direct mapped domain
Date: Wed, 10 Jun 2015 18:36:18 +0300	[thread overview]
Message-ID: <20150610153618.GA10549@mwanda> (raw)

Hello Joerg Roedel,

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

The patch 0a3da4517107: "iommu/amd: Put IOMMUv2 devices in a direct 
mapped domain" from May 28, 2015, leads to the following Smatch 
complaint:

drivers/iommu/amd_iommu.c:2285 amd_iommu_add_device()
	 error: we previously assumed 'dev_data' could be null (see line 2279)

drivers/iommu/amd_iommu.c
  2278		dev_data = get_dev_data(dev);
  2279		if (dev_data && dev_data->iommu_v2)
                    ^^^^^^^^
Check.

  2280			iommu_request_dm_for_dev(dev);
  2281	
  2282		/* Domains are initialized for this device - have a look what we ended up with */
  2283		domain = iommu_get_domain_for_dev(dev);
  2284		if (domain->type == IOMMU_DOMAIN_IDENTITY) {
  2285			dev_data->passthrough = true;
                        ^^^^^^^^^^
Unchecked dereference.

  2286			dev->archdata.dma_ops = &nommu_dma_ops;
  2287		} else {

regards,
dan carpenter

             reply	other threads:[~2015-06-10 15:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10 15:36 Dan Carpenter [this message]
2015-06-11  7:35 ` [PATCH] iommu/amd: Handle errors returned from iommu_init_device Joerg Roedel

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=20150610153618.GA10549@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=jroedel-l3A5Bk7waGM@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