mirror of
				https://github.com/gnif/LookingGlass.git
				synced 2025-11-04 06:31:54 +00:00 
			
		
		
		
	[common] ivshmem: fix failure to check ioctl for error result
This commit is contained in:
		@@ -119,7 +119,7 @@ bool ivshmemOpenDev(struct IVSHMEM * dev, const char * shmDevice)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  DEBUG_ASSERT(dev);
 | 
					  DEBUG_ASSERT(dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  unsigned int devSize;
 | 
					  int devSize;
 | 
				
			||||||
  int devFd;
 | 
					  int devFd;
 | 
				
			||||||
  bool hasDMA;
 | 
					  bool hasDMA;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -139,6 +139,12 @@ bool ivshmemOpenDev(struct IVSHMEM * dev, const char * shmDevice)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // get the device size
 | 
					    // get the device size
 | 
				
			||||||
    devSize = ioctl(devFd, KVMFR_DMABUF_GETSIZE, 0);
 | 
					    devSize = ioctl(devFd, KVMFR_DMABUF_GETSIZE, 0);
 | 
				
			||||||
 | 
					    if (devSize < 0)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      DEBUG_ERROR("Failed to get the device size");
 | 
				
			||||||
 | 
					      close(devFd);
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    hasDMA = true;
 | 
					    hasDMA = true;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user