diff options
author | phk <phk@FreeBSD.org> | 2003-11-23 10:22:51 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-11-23 10:22:51 +0000 |
commit | d6105943a4839202e0cf22f677b9163fef122116 (patch) | |
tree | 73cdcd994059a3d9b98f7fd235e3e4d174b12afb /sys/dev/led | |
parent | d14535d3cc394c52508f4701cebf279975deb2ce (diff) | |
download | FreeBSD-src-d6105943a4839202e0cf22f677b9163fef122116.zip FreeBSD-src-d6105943a4839202e0cf22f677b9163fef122116.tar.gz |
Avoid NULL pointer dereference.
Approved by: re@
Diffstat (limited to 'sys/dev/led')
-rw-r--r-- | sys/dev/led/led.c | 3 |
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); } |