stack walker typo and improvement
diff --git a/tools/stackcount b/tools/stackcount
index b6cc3b6..7b4aa43 100755
--- a/tools/stackcount
+++ b/tools/stackcount
@@ -86,10 +86,10 @@
         u64 ret = 0;
         if (bpf_probe_read(&ret, sizeof(ret), (void *)(*bp+8)))
             return 0;
-        if (!ret || ret < __START_KERNEL_map)
-            return 0;
         if (bpf_probe_read(bp, sizeof(*bp), (void *)*bp))
-            bp = 0;
+            *bp = 0;
+        if (ret < __START_KERNEL_map)
+            return 0;
         return ret;
     }
     return 0;