ionic: Don't check null when calling vfree()

vfree() checks for null internally, so there's no need to
check in the caller. So, always vfree() on variables
allocated with valloc(). If the variables are never
alloc'd vfree() is still safe.

Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Link: https://lore.kernel.org/r/20231204210936.16587-4-shannon.nelson@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Brett Creeley
2023-12-04 13:09:34 -08:00
committed by Jakub Kicinski
parent 46ca79d28f
commit 2d0b80c3a5
@@ -424,14 +424,10 @@ static void ionic_qcq_free(struct ionic_lif *lif, struct ionic_qcq *qcq)
ionic_qcq_intr_free(lif, qcq);
if (qcq->cq.info) {
vfree(qcq->cq.info);
qcq->cq.info = NULL;
}
if (qcq->q.info) {
vfree(qcq->q.info);
qcq->q.info = NULL;
}
vfree(qcq->cq.info);
qcq->cq.info = NULL;
vfree(qcq->q.info);
qcq->q.info = NULL;
}
void ionic_qcqs_free(struct ionic_lif *lif)