mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 09:34:17 +00:00
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
@ -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…
x
Reference in New Issue
Block a user