xen-netback: correctly check failed allocation
Since vzalloc can be failed in memory pressure, writes -ENOMEM to xenstore to indicate error. Signed-off-by: Insu Yun <wuninsu@gmail.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
80083a3c02
commit
833b8f18ad
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue