@@ -749,17 +749,20 @@ static int xcsc_parse_of(struct xcsc_dev
vip_format = xvip_of_get_format(port);
if (IS_ERR(vip_format)) {
dev_err(dev, "Invalid media pad format in DT");
+ of_node_put(port);
return PTR_ERR(vip_format);
}
rval = of_property_read_u32(port, "reg", &port_id);
if (rval < 0) {
dev_err(dev, "No reg in DT to specify pad");
+ of_node_put(port);
return rval;
}
if (port_id != 0 && port_id != 1) {
dev_err(dev, "Invalid reg in DT");
+ of_node_put(port);
return -EINVAL;
}
xcsc->vip_formats[port_id] = vip_format;