Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 833b8f18 authored by Insu Yun's avatar Insu Yun Committed by David S. Miller
Browse files

xen-netback: correctly check failed allocation



Since vzalloc can be failed in memory pressure,
writes -ENOMEM to xenstore to indicate error.

Signed-off-by: default avatarInsu Yun <wuninsu@gmail.com>
Acked-by: default avatarWei Liu <wei.liu2@citrix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 80083a3c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -788,6 +788,12 @@ static void connect(struct backend_info *be)
	/* Use the number of queues requested by the frontend */
	be->vif->queues = vzalloc(requested_num_queues *
				  sizeof(struct xenvif_queue));
	if (!be->vif->queues) {
		xenbus_dev_fatal(dev, -ENOMEM,
				 "allocating queues");
		return;
	}

	be->vif->num_queues = requested_num_queues;
	be->vif->stalled_queues = requested_num_queues;