diff options
| author | Orit Wasserman | 2014-01-30 19:08:34 +0100 |
|---|---|---|
| committer | Juan Quintela | 2014-02-04 16:49:24 +0100 |
| commit | c91e681a558fc21073ffc491b5a022d5f340fa0b (patch) | |
| tree | d0ebb8ac354ddb77fcd75a4ce99397d5be315a89 /arch_init.c | |
| parent | Set xbzrle buffers to NULL after freeing them to avoid double free errors (diff) | |
| download | qemu-c91e681a558fc21073ffc491b5a022d5f340fa0b.tar.gz qemu-c91e681a558fc21073ffc491b5a022d5f340fa0b.tar.xz qemu-c91e681a558fc21073ffc491b5a022d5f340fa0b.zip | |
Add check for cache size smaller than page size
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'arch_init.c')
| -rw-r--r-- | arch_init.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch_init.c b/arch_init.c index 66f5e82263..8edeabee4c 100644 --- a/arch_init.c +++ b/arch_init.c @@ -178,6 +178,10 @@ static struct { int64_t xbzrle_cache_resize(int64_t new_size) { + if (new_size < TARGET_PAGE_SIZE) { + return -1; + } + if (XBZRLE.cache != NULL) { return cache_resize(XBZRLE.cache, new_size / TARGET_PAGE_SIZE) * TARGET_PAGE_SIZE; |
