aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/vnic_wq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/enic/vnic_wq.c')
-rw-r--r--drivers/net/enic/vnic_wq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/enic/vnic_wq.c b/drivers/net/enic/vnic_wq.c
index 122e33bcc578..4b2a6c6a569b 100644
--- a/drivers/net/enic/vnic_wq.c
+++ b/drivers/net/enic/vnic_wq.c
@@ -77,8 +77,10 @@ void vnic_wq_free(struct vnic_wq *wq)
77 vnic_dev_free_desc_ring(vdev, &wq->ring); 77 vnic_dev_free_desc_ring(vdev, &wq->ring);
78 78
79 for (i = 0; i < VNIC_WQ_BUF_BLKS_MAX; i++) { 79 for (i = 0; i < VNIC_WQ_BUF_BLKS_MAX; i++) {
80 kfree(wq->bufs[i]); 80 if (wq->bufs[i]) {
81 wq->bufs[i] = NULL; 81 kfree(wq->bufs[i]);
82 wq->bufs[i] = NULL;
83 }
82 } 84 }
83 85
84 wq->ctrl = NULL; 86 wq->ctrl = NULL;