summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/ibm/ehea/ehea_qmr.c')
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_qmr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_qmr.c b/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
index 9b03033bb557..a0820f72b25c 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
@@ -103,12 +103,14 @@ out_nomem:
static void hw_queue_dtor(struct hw_queue *queue)
{
- int pages_per_kpage = PAGE_SIZE / queue->pagesize;
+ int pages_per_kpage;
int i, nr_pages;
if (!queue || !queue->queue_pages)
return;
+ pages_per_kpage = PAGE_SIZE / queue->pagesize;
+
nr_pages = queue->queue_length / queue->pagesize;
for (i = 0; i < nr_pages; i += pages_per_kpage)