qemu-e2k/hw
Daniel Henrique Barboza 846cf408a4 9p: local: always return -1 on error in local_unlinkat_common
local_unlinkat_common() is supposed to always return -1 on error.
This is being done by jumps to the 'err_out' label, which is
a 'return ret' call, and 'ret' is initialized with -1.

Unfortunately there is a condition in which the function will
return 0 on error: in a case where flags == AT_REMOVEDIR, 'ret'
will be 0 when reaching

map_dirfd = openat_dir(...)

And, if map_dirfd == -1 and errno != ENOENT, the existing 'err_out'
jump will execute 'return ret', when ret is still set to zero
at that point.

This patch fixes it by changing all 'err_out' labels by
'return -1' calls, ensuring that the function will always
return -1 on error conditions. 'ret' can be left unintialized
since it's now being used just to store the result of 'unlinkat'
calls.

CC: Greg Kurz <groug@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
[groug: changed prefix in title to be "9p: local:"]
Signed-off-by: Greg Kurz <groug@kaod.org>
2020-01-20 15:11:39 +01:00
..
9pfs 9p: local: always return -1 on error in local_unlinkat_common 2020-01-20 15:11:39 +01:00
acpi hmat acpi: Build Memory Side Cache Information Structure(s) 2020-01-05 07:03:03 -05:00
adc Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
alpha hw: replace hw/i386/pc.h with a header just for the i8259 2019-12-17 19:33:49 +01:00
arm migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
audio hda-codec: fix recording rate control 2020-01-06 08:47:16 +01:00
block * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
bt Remove the core bluetooth code 2019-12-17 09:01:14 +01:00
char * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
core migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
cpu hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
cris cris: improve passing PIC interrupt vector to the CPU 2020-01-07 17:24:29 +04:00
display migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
dma lance: replace PROP_PTR with PROP_LINK 2020-01-07 17:24:29 +04:00
gpio omap-gpio: remove PROP_PTR 2020-01-07 17:24:29 +04:00
hppa hw: replace hw/i386/pc.h with a header just for the i8259 2019-12-17 19:33:49 +01:00
hyperv hyperv: Use auto rcu_read macros 2019-12-17 19:33:52 +01:00
i2c migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
i386 * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
ide vmstate: replace DeviceState with VMStateIf 2020-01-06 18:41:32 +04:00
input migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
intc apic: Use 32bit APIC ID for migration instance ID 2020-01-20 09:10:23 +01:00
ipack Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
ipmi chardev: Use QEMUChrEvent enum in IOEventHandler typedef 2020-01-08 11:15:35 +01:00
isa hw/isa/isa-bus: cleanup irq functions 2019-12-17 19:33:51 +01:00
lm32 Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
m68k Clean-ups: qom-ify serial and remove QDEV_PROP_PTR 2020-01-07 17:54:29 +00:00
mem memory-device: Fix memory pre-plug error API violations 2019-12-18 08:36:15 +01:00
microblaze microblaze: fix leak of fdevice tree blob 2019-10-04 18:49:16 +02:00
mips * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
misc migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
moxie Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
net migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
nios2 Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
nubus hw/m68k: add Nubus support 2019-10-28 19:06:47 +01:00
nvram hw/nvram/Kconfig: Restrict CHRP NVRAM to machines using OpenBIOS or SLOF 2020-01-07 12:08:39 +01:00
openrisc Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
pci migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
pci-bridge numa: move numa global variable nb_numa_nodes into MachineState 2019-09-03 11:26:55 -03:00
pci-host hw/pci-host: Add Kconfig entry to select the IGD Passthrough Host Bridge 2019-12-18 02:34:12 +01:00
pcmcia Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
ppc migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
rdma hw/rdma: Utilize ibv_reg_mr_iova for memory registration 2019-11-06 12:49:04 +02:00
riscv chardev: Use QEMUChrEvent enum in IOEventHandler typedef 2020-01-08 11:15:35 +01:00
rtc hw/rtc/mc146818: Add missing dependency on ISA Bus 2020-01-07 12:23:10 +01:00
s390x vmstate: replace DeviceState with VMStateIf 2020-01-06 18:41:32 +04:00
scsi * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
sd hw/sd: drop extra whitespace in sdhci_sysbus_realize() header 2019-12-18 08:43:19 +01:00
semihosting semihosting: add qemu_semihosting_console_inc for SYS_READC 2020-01-09 11:41:29 +00:00
sh4 sm501: make SerialMM a child, export chardev property 2020-01-07 17:24:29 +04:00
smbios smbios:ipmi: Ignore IPMI devices with no fwinfo function 2019-09-20 14:08:10 -05:00
sparc * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
sparc64 hw/nvram/Kconfig: Restrict CHRP NVRAM to machines using OpenBIOS or SLOF 2020-01-07 12:08:39 +01:00
ssi aspeed/smc: Add AST2600 timings registers 2019-12-16 10:46:34 +00:00
timer migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
tpm migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
tricore Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
unicore32 Include hw/irq.h a lot less 2019-08-16 13:31:52 +02:00
usb usb: bugfixes for xhci, usb pass-through and usb redirection. 2020-01-13 14:19:57 +00:00
vfio vfio/pci: Don't remove irqchip notifier if not registered 2020-01-06 14:19:42 -07:00
virtio virtio: reset region cache when on queue deletion 2020-01-06 12:04:51 -05:00
watchdog aspeed: Change the "scu" property definition 2019-12-16 10:46:34 +00:00
xen xen: convert "-machine igd-passthru" to an accelerator property 2019-12-17 19:32:27 +01:00
xenpv Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
xtensa hw/xtensa: add virt machine 2019-10-18 20:38:10 -07:00
Kconfig Remove the core bluetooth code 2019-12-17 09:01:14 +01:00
Makefile.objs Remove the core bluetooth code 2019-12-17 09:01:14 +01:00