lib/vhost: Handle realloc failure
Change-Id: I47157e33e306205fa261e65e4b99fa13c1f1148d Signed-off-by: Ziye Yang <ziye.yang@intel.com>
This commit is contained in:
parent
1bbb43c544
commit
fea78497a1
@ -410,6 +410,10 @@ add_one_guest_page(struct virtio_net *dev, uint64_t guest_phys_addr,
|
||||
dev->max_guest_pages *= 2;
|
||||
dev->guest_pages = realloc(dev->guest_pages,
|
||||
dev->max_guest_pages * sizeof(*page));
|
||||
if (!dev->guest_pages) {
|
||||
RTE_LOG(ERR, VHOST_CONFIG, "cannot realloc guest_pages\n");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
if (dev->nr_guest_pages > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user