mirror of
https://github.com/corundum/corundum.git
synced 2025-01-30 08:32:52 +08:00
Remove out of memory messages; kernel should print stack trace when allocation fails
This commit is contained in:
parent
2adaf820b5
commit
79f778d85a
@ -41,10 +41,8 @@ int mqnic_create_cq_ring(struct mqnic_priv *priv, struct mqnic_cq_ring **ring_pt
|
||||
int ret;
|
||||
|
||||
ring = kzalloc(sizeof(*ring), GFP_KERNEL);
|
||||
if (!ring) {
|
||||
dev_err(dev, "Failed to allocate CQ ring");
|
||||
if (!ring)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
ring->ndev = priv->ndev;
|
||||
|
||||
@ -56,7 +54,6 @@ int mqnic_create_cq_ring(struct mqnic_priv *priv, struct mqnic_cq_ring **ring_pt
|
||||
ring->buf = dma_alloc_coherent(dev, ring->buf_size,
|
||||
&ring->buf_dma_addr, GFP_KERNEL);
|
||||
if (!ring->buf) {
|
||||
dev_err(dev, "Failed to allocate CQ ring DMA buffer");
|
||||
ret = -ENOMEM;
|
||||
goto fail_ring;
|
||||
}
|
||||
|
@ -41,10 +41,8 @@ int mqnic_create_eq_ring(struct mqnic_priv *priv, struct mqnic_eq_ring **ring_pt
|
||||
int ret;
|
||||
|
||||
ring = kzalloc(sizeof(*ring), GFP_KERNEL);
|
||||
if (!ring) {
|
||||
dev_err(dev, "Failed to allocate EQ ring");
|
||||
if (!ring)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
ring->ndev = priv->ndev;
|
||||
|
||||
@ -56,7 +54,6 @@ int mqnic_create_eq_ring(struct mqnic_priv *priv, struct mqnic_eq_ring **ring_pt
|
||||
ring->buf = dma_alloc_coherent(dev, ring->buf_size,
|
||||
&ring->buf_dma_addr, GFP_KERNEL);
|
||||
if (!ring->buf) {
|
||||
dev_err(dev, "Failed to allocate EQ ring DMA buffer");
|
||||
ret = -ENOMEM;
|
||||
goto fail_ring;
|
||||
}
|
||||
|
@ -155,10 +155,8 @@ static int mqnic_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent
|
||||
#endif
|
||||
|
||||
mqnic = devm_kzalloc(dev, sizeof(*mqnic), GFP_KERNEL);
|
||||
if (!mqnic) {
|
||||
dev_err(dev, "Failed to allocate memory");
|
||||
if (!mqnic)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
mqnic->dev = dev;
|
||||
mqnic->pdev = pdev;
|
||||
|
@ -40,10 +40,8 @@ int mqnic_create_port(struct mqnic_priv *priv, struct mqnic_port **port_ptr,
|
||||
struct mqnic_port *port;
|
||||
|
||||
port = kzalloc(sizeof(*port), GFP_KERNEL);
|
||||
if (!port) {
|
||||
dev_err(dev, "Failed to allocate port");
|
||||
if (!port)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
*port_ptr = port;
|
||||
|
||||
|
@ -41,10 +41,8 @@ int mqnic_create_rx_ring(struct mqnic_priv *priv, struct mqnic_ring **ring_ptr,
|
||||
int ret;
|
||||
|
||||
ring = kzalloc(sizeof(*ring), GFP_KERNEL);
|
||||
if (!ring) {
|
||||
dev_err(dev, "Failed to allocate RX ring");
|
||||
if (!ring)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
ring->size = roundup_pow_of_two(size);
|
||||
ring->size_mask = ring->size - 1;
|
||||
@ -56,7 +54,6 @@ int mqnic_create_rx_ring(struct mqnic_priv *priv, struct mqnic_ring **ring_ptr,
|
||||
|
||||
ring->rx_info = kvzalloc(sizeof(*ring->rx_info) * ring->size, GFP_KERNEL);
|
||||
if (!ring->rx_info) {
|
||||
dev_err(dev, "Failed to allocate rx_info");
|
||||
ret = -ENOMEM;
|
||||
goto fail_ring;
|
||||
}
|
||||
@ -65,7 +62,6 @@ int mqnic_create_rx_ring(struct mqnic_priv *priv, struct mqnic_ring **ring_ptr,
|
||||
ring->buf = dma_alloc_coherent(dev, ring->buf_size,
|
||||
&ring->buf_dma_addr, GFP_KERNEL);
|
||||
if (!ring->buf) {
|
||||
dev_err(dev, "Failed to allocate RX ring DMA buffer");
|
||||
ret = -ENOMEM;
|
||||
goto fail_info;
|
||||
}
|
||||
|
@ -42,10 +42,8 @@ int mqnic_create_tx_ring(struct mqnic_priv *priv, struct mqnic_ring **ring_ptr,
|
||||
int ret;
|
||||
|
||||
ring = kzalloc(sizeof(*ring), GFP_KERNEL);
|
||||
if (!ring) {
|
||||
dev_err(dev, "Failed to allocate TX ring");
|
||||
if (!ring)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
ring->size = roundup_pow_of_two(size);
|
||||
ring->full_size = ring->size >> 1;
|
||||
@ -58,7 +56,6 @@ int mqnic_create_tx_ring(struct mqnic_priv *priv, struct mqnic_ring **ring_ptr,
|
||||
|
||||
ring->tx_info = kvzalloc(sizeof(*ring->tx_info) * ring->size, GFP_KERNEL);
|
||||
if (!ring->tx_info) {
|
||||
dev_err(dev, "Failed to allocate tx_info");
|
||||
ret = -ENOMEM;
|
||||
goto fail_ring;
|
||||
}
|
||||
@ -67,7 +64,6 @@ int mqnic_create_tx_ring(struct mqnic_priv *priv, struct mqnic_ring **ring_ptr,
|
||||
ring->buf = dma_alloc_coherent(dev, ring->buf_size,
|
||||
&ring->buf_dma_addr, GFP_KERNEL);
|
||||
if (!ring->buf) {
|
||||
dev_err(dev, "Failed to allocate TX ring DMA buffer");
|
||||
ret = -ENOMEM;
|
||||
goto fail_info;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user