Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282007
b: refs/heads/master
c: 6da64fd
h: refs/heads/master
i:
  282005: 4d3c4c2
  282003: 1bef8eb
  281999: ef56835
v: v3
  • Loading branch information
Thomas Meyer authored and Avi Kivity committed Dec 27, 2011
1 parent b59223f commit f2056bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fb92045843a8cd99c7b843d9b567a680a3854ba1
refs/heads/master: 6da64fdb8c0c683016b70c96200057347aa8fbb0
11 changes: 5 additions & 6 deletions trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,10 +775,10 @@ int __kvm_set_memory_region(struct kvm *kvm,

if (!npages) {
r = -ENOMEM;
slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL);
slots = kmemdup(kvm->memslots, sizeof(struct kvm_memslots),
GFP_KERNEL);
if (!slots)
goto out_free;
memcpy(slots, kvm->memslots, sizeof(struct kvm_memslots));
if (mem->slot >= slots->nmemslots)
slots->nmemslots = mem->slot + 1;
slots->generation++;
Expand Down Expand Up @@ -810,10 +810,10 @@ int __kvm_set_memory_region(struct kvm *kvm,
}

r = -ENOMEM;
slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL);
slots = kmemdup(kvm->memslots, sizeof(struct kvm_memslots),
GFP_KERNEL);
if (!slots)
goto out_free;
memcpy(slots, kvm->memslots, sizeof(struct kvm_memslots));
if (mem->slot >= slots->nmemslots)
slots->nmemslots = mem->slot + 1;
slots->generation++;
Expand Down Expand Up @@ -2520,10 +2520,9 @@ int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
if (bus->dev_count > NR_IOBUS_DEVS-1)
return -ENOSPC;

new_bus = kzalloc(sizeof(struct kvm_io_bus), GFP_KERNEL);
new_bus = kmemdup(bus, sizeof(struct kvm_io_bus), GFP_KERNEL);
if (!new_bus)
return -ENOMEM;
memcpy(new_bus, bus, sizeof(struct kvm_io_bus));
kvm_io_bus_insert_dev(new_bus, dev, addr, len);
rcu_assign_pointer(kvm->buses[bus_idx], new_bus);
synchronize_srcu_expedited(&kvm->srcu);
Expand Down

0 comments on commit f2056bf

Please sign in to comment.