diff options
author | np <np@FreeBSD.org> | 2016-03-20 05:01:40 +0000 |
---|---|---|
committer | np <np@FreeBSD.org> | 2016-03-20 05:01:40 +0000 |
commit | f123f2ce18da0576fdc172a9998986f0057ad704 (patch) | |
tree | 94c4bb5df3b3d377a901b081055dd7429c8f6a96 /sys/kern/subr_sglist.c | |
parent | f36ffd2dd3da7f7cfa11d1c86438a9bafd0076e9 (diff) | |
download | FreeBSD-src-f123f2ce18da0576fdc172a9998986f0057ad704.zip FreeBSD-src-f123f2ce18da0576fdc172a9998986f0057ad704.tar.gz |
MFC r277759 (by jhb@)
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.
PR: 208136
Diffstat (limited to 'sys/kern/subr_sglist.c')
-rw-r--r-- | sys/kern/subr_sglist.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); } |