validation BUGFIX error for opaque nodes

Must be checked before module as opque
nodes have none (or can have none).
diff --git a/src/validation.c b/src/validation.c
index 512fd24..e53fb30 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -1345,20 +1345,21 @@
             continue;
         }
 
-        if (!node->parent && mod && (lyd_owner_module(node) != mod)) {
-            /* all top-level data from this module checked */
-            break;
-        }
-
         LOG_LOCSET(node->schema, node, NULL, NULL);
 
         /* opaque data */
         if (!node->schema) {
             r = lyd_parse_opaq_error(node);
-            LOG_LOCBACK(1, 1, 0, 0);
+            LOG_LOCBACK(0, 1, 0, 0);
             return r;
         }
 
+        if (!node->parent && mod && (lyd_owner_module(node) != mod)) {
+            /* all top-level data from this module checked */
+            LOG_LOCBACK(1, 1, 0, 0);
+            break;
+        }
+
         /* no state/input/output/op data */
         innode = NULL;
         if ((val_opts & LYD_VALIDATE_NO_STATE) && (node->schema->flags & LYS_CONFIG_R)) {