Commit 772034b6 authored by Peter Maydell's avatar Peter Maydell Committed by Riku Voipio
Browse files

linux-user: Check dump_write() return in elf_core_dump()



One of the calls to dump_write() in elf_core_dump() was missing
a check for failure (spotted by Coverity). Add the check to
bring it into line with the other calls from this function.

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarRiku Voipio <riku.voipio@linaro.org>
parent e5a869ed
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3050,7 +3050,9 @@ static int elf_core_dump(int signr, const CPUArchState *env)
        phdr.p_align = ELF_EXEC_PAGESIZE;

        bswap_phdr(&phdr, 1);
        dump_write(fd, &phdr, sizeof (phdr));
        if (dump_write(fd, &phdr, sizeof(phdr)) != 0) {
            goto out;
        }
    }

    /*