summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-11-23 10:22:51 +0000
committerphk <phk@FreeBSD.org>2003-11-23 10:22:51 +0000
commitd6105943a4839202e0cf22f677b9163fef122116 (patch)
tree73cdcd994059a3d9b98f7fd235e3e4d174b12afb /sys
parentd14535d3cc394c52508f4701cebf279975deb2ce (diff)
downloadFreeBSD-src-d6105943a4839202e0cf22f677b9163fef122116.zip
FreeBSD-src-d6105943a4839202e0cf22f677b9163fef122116.tar.gz
Avoid NULL pointer dereference.
Approved by: re@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/led/led.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/led/led.c b/sys/dev/led/led.c
index 45012bd..a4e8d7b 100644
--- a/sys/dev/led/led.c
+++ b/sys/dev/led/led.c
@@ -254,7 +254,8 @@ led_destroy(dev_t dev)
mtx_lock(&led_mtx);
LIST_REMOVE(sc, list);
mtx_unlock(&led_mtx);
- sbuf_delete(sc->spec);
+ if (sc->spec != NULL)
+ sbuf_delete(sc->spec);
destroy_dev(dev);
free(sc, M_LED);
}
OpenPOWER on IntegriCloud