summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_timeout.c4
-rw-r--r--sys/kern/subr_sglist.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index 13822fd..1d5d24f 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -1096,6 +1096,10 @@ _callout_stop_safe(struct callout *c, int safe)
struct lock_class *class;
int direct, sq_locked, use_lock;
+ if (safe)
+ WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock,
+ "calling %s", __func__);
+
/*
* Some old subsystems don't hold Giant while running a callout_stop(),
* so just discard this check for the moment.
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);
}
OpenPOWER on IntegriCloud