From c5ac2eb628656fbcba77f3ea79ce6a10cce4a299 Mon Sep 17 00:00:00 2001 From: jhb Date: Mon, 26 Jan 2015 16:26:28 +0000 Subject: Fix a couple of panics when detaching from a cxgbe/cxl interface that was never brought up: - Allow NULL to be passed to sglist_free(). - Don't try to stop an interface that was never fully initialized. Reviewed by: np --- sys/kern/subr_sglist.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys/kern/subr_sglist.c') diff --git a/sys/kern/subr_sglist.c b/sys/kern/subr_sglist.c index c66973a..df88a26 100644 --- a/sys/kern/subr_sglist.c +++ b/sys/kern/subr_sglist.c @@ -216,6 +216,9 @@ void sglist_free(struct sglist *sg) { + if (sg == NULL) + return; + if (refcount_release(&sg->sg_refs)) free(sg, M_SGLIST); } -- cgit v1.1