mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Bryan O'Sullivan" <bos@pathscale.com>
To: rdreier@cisco.com
Cc: linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: [PATCH 5 of 10] ipath - fix NULL dereference during cleanup
Date: Tue, 23 May 2006 11:32:33 -0700	[thread overview]
Message-ID: <6bf52c0f0f0d0df39a78.1148409153@eng-12.pathscale.com> (raw)
In-Reply-To: <patchbomb.1148409148@eng-12.pathscale.com>

Fix NULL deref due to pcidev being clobbered before dd->ipath_f_cleanup()
was called.

Signed-off-by: Bryan O'Sullivan <bos@pathscale.com>

diff -r c7cf56636dd1 -r 6bf52c0f0f0d drivers/infiniband/hw/ipath/ipath_driver.c
--- a/drivers/infiniband/hw/ipath/ipath_driver.c	Tue May 23 11:29:15 2006 -0700
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c	Tue May 23 11:29:15 2006 -0700
@@ -1905,19 +1905,19 @@ static void __exit infinipath_cleanup(vo
 			} else
 				ipath_dbg("irq is 0, not doing free_irq "
 					  "for unit %u\n", dd->ipath_unit);
+
+			/*
+			 * we check for NULL here, because it's outside
+			 * the kregbase check, and we need to call it
+			 * after the free_irq.  Thus it's possible that
+			 * the function pointers were never initialized.
+			 */
+			if (dd->ipath_f_cleanup)
+				/* clean up chip-specific stuff */
+				dd->ipath_f_cleanup(dd);
+
 			dd->pcidev = NULL;
 		}
-
-		/*
-		 * we check for NULL here, because it's outside the kregbase
-		 * check, and we need to call it after the free_irq.  Thus
-		 * it's possible that the function pointers were never
-		 * initialized.
-		 */
-		if (dd->ipath_f_cleanup)
-			/* clean up chip-specific stuff */
-			dd->ipath_f_cleanup(dd);
-
 		spin_lock_irqsave(&ipath_devs_lock, flags);
 	}
 

  parent reply	other threads:[~2006-05-23 18:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-23 18:32 [PATCH 0 of 10] ipath patches for 2.6.17 Bryan O'Sullivan
2006-05-23 18:32 ` [PATCH 1 of 10] ipath - fix spinlock recursion bug Bryan O'Sullivan
2006-05-23 21:09   ` Roland Dreier
2006-05-23 21:26     ` Bryan O'Sullivan
2006-05-23 21:31       ` Roland Dreier
2006-05-24 14:45         ` Bryan O'Sullivan
2006-05-23 18:32 ` [PATCH 2 of 10] ipath - don't modify QP if changes fail Bryan O'Sullivan
2006-05-23 18:32 ` [PATCH 3 of 10] ipath - fix reporting of driver version to userspace Bryan O'Sullivan
2006-05-23 18:32 ` [PATCH 4 of 10] ipath - replace uses of LIST_POISON Bryan O'Sullivan
2006-05-23 18:32 ` Bryan O'Sullivan [this message]
2006-05-23 18:32 ` [PATCH 6 of 10] ipath - enable GPIO interrupt on HT-460 Bryan O'Sullivan
2006-05-23 18:32 ` [PATCH 7 of 10] ipath - enable PE800 receive interrupts on user ports Bryan O'Sullivan
2006-05-23 18:32 ` [PATCH 8 of 10] ipath - register as IB device owner Bryan O'Sullivan
2006-05-23 18:32 ` [PATCH 9 of 10] ipath - fix null deref during rdma ops Bryan O'Sullivan
2006-05-23 18:32 ` [PATCH 10 of 10] ipath - deref correct pointer when using kernel SMA Bryan O'Sullivan

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=6bf52c0f0f0d0df39a78.1148409153@eng-12.pathscale.com \
    --to=bos@pathscale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openib-general@openib.org \
    --cc=rdreier@cisco.com \
    /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

Powered by JetHome