Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83217790 authored by Roopa Prabhu's avatar Roopa Prabhu Committed by David S. Miller
Browse files

enic: Check if rq/wq buf not NULL before freeing them

parent ce16cc02
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -77,9 +77,11 @@ void vnic_rq_free(struct vnic_rq *rq)
	vnic_dev_free_desc_ring(vdev, &rq->ring);

	for (i = 0; i < VNIC_RQ_BUF_BLKS_MAX; i++) {
		if (rq->bufs[i]) {
			kfree(rq->bufs[i]);
			rq->bufs[i] = NULL;
		}
	}

	rq->ctrl = NULL;
}
+4 −2
Original line number Diff line number Diff line
@@ -77,9 +77,11 @@ void vnic_wq_free(struct vnic_wq *wq)
	vnic_dev_free_desc_ring(vdev, &wq->ring);

	for (i = 0; i < VNIC_WQ_BUF_BLKS_MAX; i++) {
		if (wq->bufs[i]) {
			kfree(wq->bufs[i]);
			wq->bufs[i] = NULL;
		}
	}

	wq->ctrl = NULL;
}