]> git.feebdaed.xyz Git - 0xmirror/qemu.git/commit
chardev/char-file: fix failure path
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Tue, 14 Oct 2025 14:50:28 +0000 (17:50 +0300)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 25 Nov 2025 07:09:07 +0000 (11:09 +0400)
commit313f6884c8cd585756df6cc87692e434157c87f1
tree1304deb44cd3e72a2e99ae688bb4e0e97bcb39fd
parent4be62d311791bf9d318f5139439d170ad5112279
chardev/char-file: fix failure path

'in' will be -1 when file->in is unset. Let's not try to close
invalid fd.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Coverity: CID 1630444
Fixes: 69620c091d62f "chardev: qemu_chr_open_fd(): add errp"
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20251014145029.949285-1-vsementsov@yandex-team.ru>
chardev/char-file.c