Add a jump target so that a bit of exception handling can be better reused
at the end of this function.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
}
info = kzalloc(sizeof(*info), GFP_KERNEL);
- if (!info) {
- of_node_put(info_np);
- return NULL;
- }
+ if (!info)
+ goto put_node;
ret |= of_property_read_u32(info_np, "ac-bias", &info->ac_bias);
ret |= of_property_read_u32(info_np, "ac-bias-intrpt", &info->ac_bias_intrpt);
if (ret) {
pr_err("%s: error reading panel-info properties\n", __func__);
kfree(info);
- of_node_put(info_np);
- return NULL;
+ info = NULL;
}
- of_node_put(info_np);
+put_node:
+ of_node_put(info_np);
return info;
}