media: i2c: ov5647: replacing of_node_put with __free(device_node)
BugLink: https://bugs.launchpad.net/bugs/2083656 [ Upstream commit 971b4eef86ccb8b107ad2875993e510eec4fdeae ] Replace instance of of_node_put with __free(device_node) to protect against any memory leaks due to future changes in control flow. Signed-off-by: Abdulrasaq Lawani <abdulrasaqolawani@gmail.com> Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sasha Levin <sashal@kernel.org> [koichiroden: adjusted context due to missing upstream commit: c188df3db167 ("media: i2c: replace of_graph_get_next_endpoint()")] Signed-off-by: Koichiro Den <koichiro.den@canonical.com> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
This commit is contained in:
committed by
Mehmet Basaran
parent
d0479531cd
commit
3e0a23b069
@@ -1360,24 +1360,21 @@ static int ov5647_parse_dt(struct ov5647 *sensor, struct device_node *np)
|
||||
struct v4l2_fwnode_endpoint bus_cfg = {
|
||||
.bus_type = V4L2_MBUS_CSI2_DPHY,
|
||||
};
|
||||
struct device_node *ep;
|
||||
struct device_node *ep __free(device_node) =
|
||||
of_graph_get_endpoint_by_regs(np, 0, -1);
|
||||
int ret;
|
||||
|
||||
ep = of_graph_get_next_endpoint(np, NULL);
|
||||
if (!ep)
|
||||
return -EINVAL;
|
||||
|
||||
ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &bus_cfg);
|
||||
if (ret)
|
||||
goto out;
|
||||
return ret;
|
||||
|
||||
sensor->clock_ncont = bus_cfg.bus.mipi_csi2.flags &
|
||||
V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK;
|
||||
|
||||
out:
|
||||
of_node_put(ep);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ov5647_probe(struct i2c_client *client)
|
||||
|
||||
Reference in New Issue
Block a user