]> git.ipfire.org Git - thirdparty/qemu.git/commit
system/memory: Split address_space_write_rom_internal
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 22 Sep 2025 19:29:40 +0000 (12:29 -0700)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 7 Oct 2025 01:37:04 +0000 (03:37 +0200)
commitbb02dcf2d4c0ec446fb53516eea76087f8b7a3ed
treeb5313e746f84f4e2507c816312fa0ac176763ce1
parent6feb119d32ed1b8853e407495fad33795b9c2137
system/memory: Split address_space_write_rom_internal

In 2dbaf58bbe7 we conditionally skipped the increment
of buf because ubsan warns incrementing NULL, and buf
is always NULL for FLUSH_CACHE.  However, the existence
of the test for NULL caused Coverity to warn that the
memcpy in the WRITE_DATA case lacked a test for NULL.

Duplicate address_space_write_rom_internal into the two
callers, dropping enum write_rom_type, and simplify.
This eliminates buf in the flush case, and eliminates
the conditional increment of buf in the write case.

Coverity: CID 1621220
Fixes: 2dbaf58bbe7 ("system/physmem: Silence warning from ubsan")
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250922192940.2908002-1-richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
system/physmem.c