summaryrefslogtreecommitdiffstats
path: root/sys/dev/mps
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2013-05-22 02:15:07 +0000
committermav <mav@FreeBSD.org>2013-05-22 02:15:07 +0000
commit0389554b1afa82981e507befda68b56631251990 (patch)
tree6209b1b4bacf9ac4af7127329830233879e6f2aa /sys/dev/mps
parent00639a30cfe2aba831ddd12cd8df32c5a66bfb04 (diff)
downloadFreeBSD-src-0389554b1afa82981e507befda68b56631251990.zip
FreeBSD-src-0389554b1afa82981e507befda68b56631251990.tar.gz
Fix NULL-dereference kernel panic in case of mps_attach() failure.
MFC after: 1 week
Diffstat (limited to 'sys/dev/mps')
-rw-r--r--sys/dev/mps/mps_user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/mps/mps_user.c b/sys/dev/mps/mps_user.c
index 3183df8..0413d3f 100644
--- a/sys/dev/mps/mps_user.c
+++ b/sys/dev/mps/mps_user.c
@@ -208,8 +208,8 @@ mps_detach_user(struct mps_softc *sc)
{
/* XXX: do a purge of pending requests? */
- destroy_dev(sc->mps_cdev);
-
+ if (sc->mps_cdev != NULL)
+ destroy_dev(sc->mps_cdev);
}
static int
OpenPOWER on IntegriCloud