Commit eef9b794 authored by Jakub Kicinski's avatar Jakub Kicinski

tools: ynl-gen: add error checking for nested structs

Parsing nested types may return an error, propagate it.
Not marking as a fix, because nothing uses YNL upstream.
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 5605f102
......@@ -424,7 +424,8 @@ class TypeNest(Type):
f"{self.enum_name}, &{var}->{self.c_name})")
def _attr_get(self, ri, var):
get_lines = [f"{self.nested_render_name}_parse(&parg, attr);"]
get_lines = [f"if ({self.nested_render_name}_parse(&parg, attr))",
"return MNL_CB_ERROR;"]
init_lines = [f"parg.rsp_policy = &{self.nested_render_name}_nest;",
f"parg.data = &{var}->{self.c_name};"]
return get_lines, init_lines, None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment