bpf: Remove recursion call in btf_struct_access
[linux-2.6-microblaze.git] / kernel / bpf / btf.c
index ee0e2a5..4488c5b 100644 (file)
@@ -3931,14 +3931,13 @@ again:
                /* Only allow structure for now, can be relaxed for
                 * other types later.
                 */
-               elem_type = btf_type_skip_modifiers(btf_vmlinux,
-                                                   array_elem->type, NULL);
-               if (!btf_type_is_struct(elem_type))
+               t = btf_type_skip_modifiers(btf_vmlinux, array_elem->type,
+                                           NULL);
+               if (!btf_type_is_struct(t))
                        goto error;
 
-               off = (off - moff) % elem_type->size;
-               return btf_struct_access(log, elem_type, off, size, atype,
-                                        next_btf_id);
+               off = (off - moff) % t->size;
+               goto again;
 
 error:
                bpf_log(log, "access beyond struct %s at off %u size %u\n",