migration: fix RAMBlock add NULL check
commitf75ed59f40bed3ce94adad4b3ebbb7bfacfdf4ab
authorDmitry Frolov <frolov@swemel.ru>
Tue, 10 Oct 2023 10:48:53 +0000 (10 13:48 +0300)
committerJuan Quintela <quintela@redhat.com>
Tue, 17 Oct 2023 07:14:32 +0000 (17 09:14 +0200)
treedc94543f961b774fd08a9b94cbc078b47e239881
parent8b2395970aa3beab91b98dda89c7ed471e65ad25
migration: fix RAMBlock add NULL check

qemu_ram_block_from_host() may return NULL, which will be dereferenced w/o
check. Usualy return value is checked for this function.
Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Frolov <frolov@swemel.ru>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231010104851.802947-1-frolov@swemel.ru>
migration/ram.c