diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c index 0dd9e4e62f8d..50d57e192c06 100644 --- a/usr.bin/netstat/inet6.c +++ b/usr.bin/netstat/inet6.c @@ -348,7 +348,8 @@ ip6_stats(off, name) if (off == 0) return; - kread(off, (char *)&ip6stat, sizeof (ip6stat)); + if (kread(off, (char *)&ip6stat, sizeof (ip6stat))) + return; printf("%s:\n", name); #define p(f, m) if (ip6stat.f || sflag <= 1) \