Skip to content
Snippets Groups Projects
Commit 8f1bdb0e authored by Peter Maydell's avatar Peter Maydell
Browse files

softmmu/physmem.c: Remove unneeded NULL check in qemu_ram_alloc_from_fd()


In the alignment check added to qemu_ram_alloc_from_fd() in commit
ce317be9, the condition includes a check that 'mr' is not
NULL.  This check is unnecessary because we can assume that the
caller always passes us a valid MemoryRegion, and indeed later in the
function we assume mr is not NULL when we pass it to file_ram_alloc()
as new_block->mr.  Remove it.

Fixes: Coverity 1459867
Fixes: ce317be9 ("exec: fetch the alignment of Linux devdax pmem character device nodes")
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: default avatarJingqi Liu <jingqi.liu@intel.com>
Message-id: 20210812150624.29139-1-peter.maydell@linaro.org
parent 312c496a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment