summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sys/vmsystm.h3
-rw-r--r--modules/splat/splat-kmem.c22
2 files changed, 8 insertions, 17 deletions
diff --git a/include/sys/vmsystm.h b/include/sys/vmsystm.h
index f0688393c..e10a1dc54 100644
--- a/include/sys/vmsystm.h
+++ b/include/sys/vmsystm.h
@@ -72,9 +72,6 @@ copyinstr(const void *from, void *to, size_t len, size_t *done)
if (len == 0)
return -ENAMETOOLONG;
- if (len < 0)
- return -EFAULT;
-
/* XXX: Should return ENAMETOOLONG if 'strlen(from) > len' */
memset(to, 0, len);
diff --git a/modules/splat/splat-kmem.c b/modules/splat/splat-kmem.c
index 27e27a5c8..bc15bc64a 100644
--- a/modules/splat/splat-kmem.c
+++ b/modules/splat/splat-kmem.c
@@ -262,14 +262,11 @@ splat_kmem_cache_test_constructor(void *ptr, void *priv, int flags)
kmem_cache_priv_t *kcp = (kmem_cache_priv_t *)priv;
kmem_cache_data_t *kcd = (kmem_cache_data_t *)ptr;
- if (kcd) {
- if (kcp) {
- kcd->kcd_magic = kcp->kcp_magic;
- kcp->kcp_count++;
- }
-
- memset(kcd->kcd_buf, 0xaa, kcp->kcp_size - (sizeof *kcd));
+ if (kcd && kcp) {
+ kcd->kcd_magic = kcp->kcp_magic;
kcd->kcd_flag = 1;
+ memset(kcd->kcd_buf, 0xaa, kcp->kcp_size - (sizeof *kcd));
+ kcp->kcp_count++;
}
return 0;
@@ -281,14 +278,11 @@ splat_kmem_cache_test_destructor(void *ptr, void *priv)
kmem_cache_priv_t *kcp = (kmem_cache_priv_t *)priv;
kmem_cache_data_t *kcd = (kmem_cache_data_t *)ptr;
- if (kcd) {
- if (kcp) {
- kcd->kcd_magic = 0;
- kcp->kcp_count--;
- }
-
- memset(kcd->kcd_buf, 0xbb, kcp->kcp_size - (sizeof *kcd));
+ if (kcd && kcp) {
+ kcd->kcd_magic = 0;
kcd->kcd_flag = 0;
+ memset(kcd->kcd_buf, 0xbb, kcp->kcp_size - (sizeof *kcd));
+ kcp->kcp_count--;
}
return;