cndm: Fix some allocation failure handling paths

Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
Alex Forencich
2026-03-31 20:27:27 -07:00
parent 924f41c0ff
commit ae69d16b93
2 changed files with 4 additions and 4 deletions

View File

@@ -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); rq->rx_info = kvzalloc(sizeof(*rq->rx_info) * rq->size, GFP_KERNEL);
if (!rq->rx_info) if (!rq->rx_info)
ret = -ENOMEM; return -ENOMEM;
rq->buf_size = rq->size * rq->stride; rq->buf_size = rq->size * rq->stride;
rq->buf = dma_alloc_coherent(rq->dev, rq->buf_size, &rq->buf_dma_addr, GFP_KERNEL); rq->buf = dma_alloc_coherent(rq->dev, rq->buf_size, &rq->buf_dma_addr, GFP_KERNEL);
if (!rq->buf) { if (!rq->buf) {
return -ENOMEM; ret = -ENOMEM;
goto fail; goto fail;
} }

View File

@@ -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); sq->tx_info = kvzalloc(sizeof(*sq->tx_info) * sq->size, GFP_KERNEL);
if (!sq->tx_info) if (!sq->tx_info)
ret = -ENOMEM; return -ENOMEM;
sq->buf_size = sq->size * sq->stride; sq->buf_size = sq->size * sq->stride;
sq->buf = dma_alloc_coherent(sq->dev, sq->buf_size, &sq->buf_dma_addr, GFP_KERNEL); sq->buf = dma_alloc_coherent(sq->dev, sq->buf_size, &sq->buf_dma_addr, GFP_KERNEL);
if (!sq->buf) { if (!sq->buf) {
return -ENOMEM; ret = -ENOMEM;
goto fail; goto fail;
} }