[vfio:next 15/15] drivers/vfio/vfio.c:1002:32-35: ERROR: driver is NULL but dereferenced.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://github.com/awilliam/linux-vfio.git next
head:   f54e0bcf65bf7d2015e1aa1c6353e5feb71c3654
commit: f54e0bcf65bf7d2015e1aa1c6353e5feb71c3654 [15/15] vfio: Include No-IOMMU mode


coccinelle warnings: (new ones prefixed by >>)

>> drivers/vfio/vfio.c:1002:32-35: ERROR: driver is NULL but dereferenced.

vim +1002 drivers/vfio/vfio.c

0b43c082 Alex Williamson 2013-04-29   986  	down_read(&container->group_lock);
0b43c082 Alex Williamson 2013-04-29   987  
0b43c082 Alex Williamson 2013-04-29   988  	driver = container->iommu_driver;
0b43c082 Alex Williamson 2013-04-29   989  
cba3345c Alex Williamson 2012-07-31   990  	switch (arg) {
cba3345c Alex Williamson 2012-07-31   991  		/* No base extensions yet */
cba3345c Alex Williamson 2012-07-31   992  	default:
cba3345c Alex Williamson 2012-07-31   993  		/*
cba3345c Alex Williamson 2012-07-31   994  		 * If no driver is set, poll all registered drivers for
cba3345c Alex Williamson 2012-07-31   995  		 * extensions and return the first positive result.  If
cba3345c Alex Williamson 2012-07-31   996  		 * a driver is already set, further queries will be passed
cba3345c Alex Williamson 2012-07-31   997  		 * only to that driver.
cba3345c Alex Williamson 2012-07-31   998  		 */
cba3345c Alex Williamson 2012-07-31   999  		if (!driver) {
cba3345c Alex Williamson 2012-07-31  1000  			mutex_lock(&vfio.iommu_drivers_lock);
f54e0bcf Alex Williamson 2015-10-15  1001  			vfio_for_each_iommu_driver(container, driver) {
cba3345c Alex Williamson 2012-07-31 @1002  				if (!try_module_get(driver->ops->owner))
cba3345c Alex Williamson 2012-07-31  1003  					continue;
cba3345c Alex Williamson 2012-07-31  1004  
cba3345c Alex Williamson 2012-07-31  1005  				ret = driver->ops->ioctl(NULL,
cba3345c Alex Williamson 2012-07-31  1006  							 VFIO_CHECK_EXTENSION,
cba3345c Alex Williamson 2012-07-31  1007  							 arg);
cba3345c Alex Williamson 2012-07-31  1008  				module_put(driver->ops->owner);
cba3345c Alex Williamson 2012-07-31  1009  				if (ret > 0)
cba3345c Alex Williamson 2012-07-31  1010  					break;

:::::: The code at line 1002 was first introduced by commit
:::::: cba3345cc494ad286ca8823f44b2c16cae496679 vfio: VFIO core

:::::: TO: Alex Williamson <alex.williamson@xxxxxxxxxx>
:::::: CC: Alex Williamson <alex.williamson@xxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux