diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index e590c3a2999d5372af2b78387ea1b2a14c359569..444d15a75d98ba072a2375fc87a881c06f6ac27c 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -567,10 +567,7 @@ static void route4_walk(struct tcf_proto *tp, struct tcf_walker *arg,
 	struct route4_head *head = rtnl_dereference(tp->root);
 	unsigned int h, h1;
 
-	if (head == NULL)
-		arg->stop = 1;
-
-	if (arg->stop)
+	if (head == NULL || arg->stop)
 		return;
 
 	for (h = 0; h <= 256; h++) {