summaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/vnic_rq.c
diff options
context:
space:
mode:
authorRoopa Prabhu <roprabhu@cisco.com>2010-08-10 18:55:20 +0000
committerDavid S. Miller <davem@davemloft.net>2010-08-17 02:32:58 -0700
commit832177901a61aeda1f2122e323c39881ec84af65 (patch)
tree4df41abbabfefc6fcd9eb32c389f36a12a8fd4f2 /drivers/net/enic/vnic_rq.c
parentce16cc02f9fe21d4e42116305e5ea9d12e51635d (diff)
enic: Check if rq/wq buf not NULL before freeing them
Signed-off-by: Scott Feldman <scofeldm@cisco.com> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic/vnic_rq.c')
-rw-r--r--drivers/net/enic/vnic_rq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/enic/vnic_rq.c b/drivers/net/enic/vnic_rq.c
index dbb2aca258b..b236d7cbc13 100644
--- a/drivers/net/enic/vnic_rq.c
+++ b/drivers/net/enic/vnic_rq.c
@@ -77,8 +77,10 @@ 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++) {
- kfree(rq->bufs[i]);
- rq->bufs[i] = NULL;
+ if (rq->bufs[i]) {
+ kfree(rq->bufs[i]);
+ rq->bufs[i] = NULL;
+ }
}
rq->ctrl = NULL;