Avoid NULL pointer dereference.

Approved by:	re@
This commit is contained in:
Poul-Henning Kamp 2003-11-23 10:22:51 +00:00
parent 00ebd9c633
commit 7e31c3b7ea

View File

@ -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);
}