mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
5c1f50ab7f
The error path for OOM when allocating buses used to return -ENOMEM using
the local variable 'r', where 'r' was initialized at the top of the
function. But a new "r = kvm_init_irq_routing(kvm);" was introduced in
the middle of the function, so now the error code is not set and it
eventually leads to a NULL dereference due to kvm_dev_ioctl_create_vm()
thinking kvm_create_vm() succeeded. Set the error code back to -ENOMEM.
Opportunistically tweak the logic to pre-set "r = -ENOMEM" immediately
before the flows that can fail due to memory allocation failure to make
it less likely that the bug recurs in the future.
Fixes:
|
||
---|---|---|
.. | ||
async_pf.c | ||
async_pf.h | ||
binary_stats.c | ||
coalesced_mmio.c | ||
coalesced_mmio.h | ||
dirty_ring.c | ||
eventfd.c | ||
guest_memfd.c | ||
irqchip.c | ||
Kconfig | ||
kvm_main.c | ||
kvm_mm.h | ||
Makefile.kvm | ||
pfncache.c | ||
vfio.c | ||
vfio.h |