[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 17/26] ivshmem: add missing error exit(2)
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 17/26] ivshmem: add missing error exit(2) |
Date: |
Fri, 14 Jun 2013 14:50:33 +0400 |
From: Stefan Hajnoczi <address@hidden>
If the user fails to specify 'chardev' or 'shm' then we cannot continue.
Exit right away so that we don't invoke shm_open(3) with a NULL pointer.
It would be nice to replace exit(1) with error returns in the PCI device
.init() function, but leave that for another patch since exit(1) is
currently used elsewhere.
Spotted by Coverity.
Cc: Cam Macdonell <address@hidden>
Cc: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
hw/misc/ivshmem.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index a19a6d6..5658f73 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -735,6 +735,7 @@ static int pci_ivshmem_init(PCIDevice *dev)
if (s->shmobj == NULL) {
fprintf(stderr, "Must specify 'chardev' or 'shm' to ivshmem\n");
+ exit(1);
}
IVSHMEM_DPRINTF("using shm_open (shm object = %s)\n", s->shmobj);
--
1.7.10.4
- [Qemu-devel] [PULL 11/26] Unbreak -no-quit for GTK, validate SDL options, (continued)
- [Qemu-devel] [PULL 11/26] Unbreak -no-quit for GTK, validate SDL options, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 25/26] cputlb: fix debug logs, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 13/26] device tree: Fix cppcheck warning, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 06/26] curl: Whitespace only changes., Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 23/26] main-loop: do not include slirp/slirp.h, use libslirp.h instead, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 10/26] gtk: implement -full-screen, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 14/26] hw/scsi: Don't increment a boolean value, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 15/26] target-sparc: Replace free by g_free, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 16/26] hw/xen: Use g_free instead of free and fix potential memory leaks, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 24/26] create qemu_openpty_raw() helper function and move it to a separate file, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 17/26] ivshmem: add missing error exit(2),
Michael Tokarev <=
- [Qemu-devel] [PULL 26/26] piix: fix some printf errors when debug is enabled, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 09/26] char/serial: serial_ioport_write: Factor out common code, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 20/26] KVM: PPC: Add dummy kvm_arch_init_irq_routing(), Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 07/26] char/serial: cosmetic fixes., Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 08/26] char/serial: Use generic Fifo8, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 22/26] libcacard/vscclient: fix leakage of socket on error paths, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 18/26] KVM: ARM: Add dummy kvm_arch_init_irq_routing(), Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 21/26] linux-headers: Update to v3.10-rc5, Michael Tokarev, 2013/06/14
- Re: [Qemu-devel] [PULL 00/26] Trivial-patches pull request for 2013-06-14, Anthony Liguori, 2013/06/17