mirror of
https://github.com/fpganinja/taxi.git
synced 2026-04-07 04:38:42 -07:00
cndm: Fix some allocation failure handling paths
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
@@ -59,12 +59,12 @@ int cndm_open_rq(struct cndm_ring *rq, struct cndm_priv *priv, struct cndm_cq *c
|
||||
|
||||
rq->rx_info = kvzalloc(sizeof(*rq->rx_info) * rq->size, GFP_KERNEL);
|
||||
if (!rq->rx_info)
|
||||
ret = -ENOMEM;
|
||||
return -ENOMEM;
|
||||
|
||||
rq->buf_size = rq->size * rq->stride;
|
||||
rq->buf = dma_alloc_coherent(rq->dev, rq->buf_size, &rq->buf_dma_addr, GFP_KERNEL);
|
||||
if (!rq->buf) {
|
||||
return -ENOMEM;
|
||||
ret = -ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,12 +59,12 @@ int cndm_open_sq(struct cndm_ring *sq, struct cndm_priv *priv, struct cndm_cq *c
|
||||
|
||||
sq->tx_info = kvzalloc(sizeof(*sq->tx_info) * sq->size, GFP_KERNEL);
|
||||
if (!sq->tx_info)
|
||||
ret = -ENOMEM;
|
||||
return -ENOMEM;
|
||||
|
||||
sq->buf_size = sq->size * sq->stride;
|
||||
sq->buf = dma_alloc_coherent(sq->dev, sq->buf_size, &sq->buf_dma_addr, GFP_KERNEL);
|
||||
if (!sq->buf) {
|
||||
return -ENOMEM;
|
||||
ret = -ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user