summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlstewart <lstewart@FreeBSD.org>2011-01-11 00:29:17 +0000
committerlstewart <lstewart@FreeBSD.org>2011-01-11 00:29:17 +0000
commit76b788457b39279da51daf8c31bf490fbbcaa2d0 (patch)
treeeb386adec3b0901533f232d04355673e0697e42f
parent1d1ef54a742aacb2b7a401e82aea2afbe218db8a (diff)
downloadFreeBSD-src-76b788457b39279da51daf8c31bf490fbbcaa2d0.zip
FreeBSD-src-76b788457b39279da51daf8c31bf490fbbcaa2d0.tar.gz
Fix some minor style/readability nits in hhook.
Sponsored by: FreeBSD Foundation Submitted by: pjd MFC after: 9 weeks X-MFC with: r216615
-rw-r--r--sys/kern/kern_hhook.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/kern/kern_hhook.c b/sys/kern/kern_hhook.c
index 946f76a..f2d8592 100644
--- a/sys/kern/kern_hhook.c
+++ b/sys/kern/kern_hhook.c
@@ -156,8 +156,7 @@ hhook_add_hook(struct hhook_head *hhh, struct hookinfo *hki, uint32_t flags)
if (!error) {
STAILQ_INSERT_TAIL(&hhh->hhh_hooks, hhk, hhk_next);
hhh->hhh_nhooks++;
- }
- else
+ } else
free(hhk, M_HHOOK);
HHH_WUNLOCK(hhh);
@@ -332,7 +331,6 @@ hhook_head_deregister_lookup(int32_t hhook_type, int32_t hhook_id)
struct hhook_head *hhh;
int error;
- error = 0;
hhh = hhook_head_get(hhook_type, hhook_id);
error = hhook_head_deregister(hhh);
@@ -356,13 +354,12 @@ hhook_head_get(int32_t hhook_type, int32_t hhook_id)
LIST_FOREACH(hhh, &V_hhook_head_list, hhh_next) {
if (hhh->hhh_type == hhook_type && hhh->hhh_id == hhook_id) {
refcount_acquire(&hhh->hhh_refcount);
- HHHLIST_UNLOCK();
- return (hhh);
+ break;
}
}
HHHLIST_UNLOCK();
- return (NULL);
+ return (hhh);
}
void
OpenPOWER on IntegriCloud