Commit e7f52aa4 authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller

ionic: init reconfig err to 0

Initialize err to 0 instead of ENOMEM, and specifically set
err to ENOMEM in the devm_kcalloc() failure cases.

Also, add an error message to the end of reconfig.
Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 73d618bb
...@@ -2588,22 +2588,26 @@ int ionic_reconfigure_queues(struct ionic_lif *lif, ...@@ -2588,22 +2588,26 @@ int ionic_reconfigure_queues(struct ionic_lif *lif,
struct ionic_qcq **tx_qcqs = NULL; struct ionic_qcq **tx_qcqs = NULL;
struct ionic_qcq **rx_qcqs = NULL; struct ionic_qcq **rx_qcqs = NULL;
unsigned int flags, i; unsigned int flags, i;
int err = -ENOMEM; int err = 0;
/* allocate temporary qcq arrays to hold new queue structs */ /* allocate temporary qcq arrays to hold new queue structs */
if (qparam->nxqs != lif->nxqs || qparam->ntxq_descs != lif->ntxq_descs) { if (qparam->nxqs != lif->nxqs || qparam->ntxq_descs != lif->ntxq_descs) {
tx_qcqs = devm_kcalloc(lif->ionic->dev, lif->ionic->ntxqs_per_lif, tx_qcqs = devm_kcalloc(lif->ionic->dev, lif->ionic->ntxqs_per_lif,
sizeof(struct ionic_qcq *), GFP_KERNEL); sizeof(struct ionic_qcq *), GFP_KERNEL);
if (!tx_qcqs) if (!tx_qcqs) {
err = -ENOMEM;
goto err_out; goto err_out;
}
} }
if (qparam->nxqs != lif->nxqs || if (qparam->nxqs != lif->nxqs ||
qparam->nrxq_descs != lif->nrxq_descs || qparam->nrxq_descs != lif->nrxq_descs ||
qparam->rxq_features != lif->rxq_features) { qparam->rxq_features != lif->rxq_features) {
rx_qcqs = devm_kcalloc(lif->ionic->dev, lif->ionic->nrxqs_per_lif, rx_qcqs = devm_kcalloc(lif->ionic->dev, lif->ionic->nrxqs_per_lif,
sizeof(struct ionic_qcq *), GFP_KERNEL); sizeof(struct ionic_qcq *), GFP_KERNEL);
if (!rx_qcqs) if (!rx_qcqs) {
err = -ENOMEM;
goto err_out; goto err_out;
}
} }
/* allocate new desc_info and rings, but leave the interrupt setup /* allocate new desc_info and rings, but leave the interrupt setup
...@@ -2782,6 +2786,9 @@ int ionic_reconfigure_queues(struct ionic_lif *lif, ...@@ -2782,6 +2786,9 @@ int ionic_reconfigure_queues(struct ionic_lif *lif,
ionic_qcq_free(lif, lif->rxqcqs[i]); ionic_qcq_free(lif, lif->rxqcqs[i]);
} }
if (err)
netdev_info(lif->netdev, "%s: failed %d\n", __func__, err);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment