diff options
author | Yuri Benditovich <yuri.benditovich@daynix.com> | 2017-04-12 16:26:30 +0300 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2017-04-12 14:53:01 +0100 |
commit | decf2c9035be6ebd30c7a1df0e9cbba5fd3be30f (patch) | |
tree | 219bcfb37561cb47d14f668c2b02a641be7deb5a | |
parent | 54a719e14f1204143da2c64f8a2aaee4fe5cd7d6 (diff) |
Avoid assert printout upon fallback of memory allocation
If the memory was requested from VRAM area but finally allocated
from DEVRAM, set memory space variable for correct verification
of allocated pointer
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
-rwxr-xr-x | qxldod/QxlDod.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp index 813ab44..746f53e 100755 --- a/qxldod/QxlDod.cpp +++ b/qxldod/QxlDod.cpp @@ -4077,8 +4077,11 @@ void *QxlDevice::AllocMem(UINT32 mspace_type, size_t size, BOOL force) FlushReleaseRing();
ptr = mspace_malloc(m_MSInfo[mspace_type]._mspace, size);
- if (!ptr && mspace_type == MSPACE_TYPE_VRAM)
- ptr = mspace_malloc(m_MSInfo[MSPACE_TYPE_DEVRAM]._mspace, size);
+ if (!ptr && mspace_type == MSPACE_TYPE_VRAM &&
+ (ptr = mspace_malloc(m_MSInfo[MSPACE_TYPE_DEVRAM]._mspace, size))) {
+ /* for proper address check at the end of the procedure */
+ mspace_type = MSPACE_TYPE_DEVRAM;
+ }
if (ptr) {
break;
}
|