Linux IOMMU Development
 help / color / mirror / Atom feed
* [bug report] iommu/arm-smmu: Make use of the iommu_register interface
@ 2017-02-15  8:36 Dan Carpenter
  2017-02-22 11:00 ` Joerg Roedel
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2017-02-15  8:36 UTC (permalink / raw)
  To: jroedel-l3A5Bk7waGM; +Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

Hello Joerg Roedel,

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

The patch 9648cbc9625b: "iommu/arm-smmu: Make use of the 
iommu_register interface" from Feb 1, 2017, leads to the following 
Smatch complaint:

drivers/iommu/arm-smmu-v3.c:1810 arm_smmu_remove_device()
	 warn: variable dereferenced before check 'master' (see line 1809)

drivers/iommu/arm-smmu-v3.c
  1808		master = fwspec->iommu_priv;
  1809		smmu = master->smmu;
                       ^^^^^^^^^^^^
New dereference.

  1810		if (master && master->ste.valid)
                    ^^^^^^
Old code checked for NULL.

  1811			arm_smmu_detach_dev(dev);
  1812		iommu_group_remove_device(dev);

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [bug report] iommu/arm-smmu: Make use of the iommu_register interface
@ 2018-03-05 14:33 Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2018-03-05 14:33 UTC (permalink / raw)
  To: jroedel-l3A5Bk7waGM; +Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

Hello Joerg Roedel,

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

The patch 9648cbc9625b: "iommu/arm-smmu: Make use of the 
iommu_register interface" from Feb 1, 2017, leads to the following 
Smatch complaint:

    ./drivers/iommu/arm-smmu-v3.c:1957 arm_smmu_remove_device()
    warn: variable dereferenced before check 'master' (see line 1956)

./drivers/iommu/arm-smmu-v3.c
  1955		master = fwspec->iommu_priv;
  1956		smmu = master->smmu;
                       ^^^^^^^^^^^^
Pach adds unchecked dereference

  1957		if (master && master->ste.assigned)
                    ^^^^^^
The old code assumes "master" can be NULL.

  1958			arm_smmu_detach_dev(dev);
  1959		iommu_group_remove_device(dev);

regards,
dan carpenter

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

end of thread, other threads:[~2018-03-05 14:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-15  8:36 [bug report] iommu/arm-smmu: Make use of the iommu_register interface Dan Carpenter
2017-02-22 11:00 ` Joerg Roedel
     [not found]   ` <20170222110042.GC4154-l3A5Bk7waGM@public.gmane.org>
2017-02-22 11:26     ` Robin Murphy
     [not found]       ` <96801505-0808-1ab0-8d10-2b6f22bec35f-5wv7dgnIgG8@public.gmane.org>
2017-02-22 12:17         ` Joerg Roedel
  -- strict thread matches above, loose matches on Subject: below --
2018-03-05 14:33 Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox