netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: huzaifas@redhat.com
To: netdev@vger.kernel.org
Cc: leitao@linux.vnet.ibm.com, Huzaifa Sidhpurwala <huzaifas@redhat.com>
Subject: [PATCH] Fix possible null pointer dereference in ehea_qmr.c
Date: Mon, 14 Mar 2011 13:16:04 +0530	[thread overview]
Message-ID: <1300088764-9330-1-git-send-email-huzaifas@redhat.com> (raw)

From: Huzaifa Sidhpurwala <huzaifas@redhat.com>

If queue is zero, dont reference it

Signed-off-by: Huzaifa Sidhpurwala <huzaifas@redhat.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

             reply	other threads:[~2011-03-14  7:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14  7:46 huzaifas [this message]
2011-03-14 22:34 ` [PATCH] Fix possible null pointer dereference in ehea_qmr.c David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1300088764-9330-1-git-send-email-huzaifas@redhat.com \
    --to=huzaifas@redhat.com \
    --cc=leitao@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).