mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[common] ivshmem: fix failure to check ioctl for error result
This commit is contained in:
parent
a3b51220ed
commit
9a53880b9b
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user