[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1300088764-9330-1-git-send-email-huzaifas@redhat.com>
Date: Mon, 14 Mar 2011 13:16:04 +0530
From: huzaifas@...hat.com
To: netdev@...r.kernel.org
Cc: leitao@...ux.vnet.ibm.com,
Huzaifa Sidhpurwala <huzaifas@...hat.com>
Subject: [PATCH] Fix possible null pointer dereference in ehea_qmr.c
From: Huzaifa Sidhpurwala <huzaifas@...hat.com>
If queue is zero, dont reference it
Signed-off-by: Huzaifa Sidhpurwala <huzaifas@...hat.com>
---
drivers/net/ehea/ehea_qmr.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c
index cd44bb8..fd0815d 100644
--- a/drivers/net/ehea/ehea_qmr.c
+++ b/drivers/net/ehea/ehea_qmr.c
@@ -106,12 +106,13 @@ 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)
--
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists