summaryrefslogtreecommitdiffstats
path: root/sys/dev/snp/snp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/snp/snp.c')
-rw-r--r--sys/dev/snp/snp.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index c4b13e5..06f17dd 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -135,10 +135,8 @@ snpread(dev, uio, flag)
caddr_t from;
char *nbuf;
-#ifdef DIAGNOSTIC
- if ((snp->snp_len + snp->snp_base) > snp->snp_blen)
- panic("snoop buffer error");
-#endif
+ KASSERT(snp->snp_len + snp->snp_base <= snp->snp_blen,
+ ("snoop buffer error"));
if (snp->snp_tty == NULL)
return (EIO);
@@ -212,10 +210,9 @@ snpin(snp, buf, n)
if (n == 0)
return 0;
-#ifdef DIAGNOSTIC
- if (n < 0)
- panic("bad snoop char count");
+ KASSERT(n > 0, ("negative snoop char count"));
+#ifdef DIAGNOSTIC
if (!(snp->snp_flags & SNOOP_OPEN)) {
printf("Snoop: data coming to closed device.\n");
return 0;
OpenPOWER on IntegriCloud