From: Johan Hovold <johan@kernel.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: Robert Foss <rfoss@kernel.org>, Todor Tomov <todor.too@gmail.com>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Marijn Suijten <marijn.suijten@somainline.org>,
Yassine Oudjana <y.oudjana@protonmail.com>,
linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] media: camss: Intepret OF graph connections more sensibly
Date: Mon, 17 Jul 2023 14:45:25 +0200 [thread overview]
Message-ID: <ZLU35SucePevwU6i@hovoldconsulting.com> (raw)
In-Reply-To: <18f2a5b5-5cc2-6bea-ca08-5da218b3192b@linaro.org>
On Mon, Jul 17, 2023 at 02:40:05PM +0200, Konrad Dybcio wrote:
> On 17.07.2023 12:48, Johan Hovold wrote:
> > On Sat, Jul 15, 2023 at 05:37:52PM +0200, Konrad Dybcio wrote:
> >> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> >> index 1ef26aea3eae..8b75197fa5d7 100644
> >> --- a/drivers/media/platform/qcom/camss/camss.c
> >> +++ b/drivers/media/platform/qcom/camss/camss.c
> >> @@ -1084,9 +1084,8 @@ static int camss_of_parse_ports(struct camss *camss)
> >>
> >> remote = of_graph_get_remote_port_parent(node);
> >> if (!remote) {
> >> - dev_err(dev, "Cannot get remote parent\n");
> >> - ret = -EINVAL;
> >> - goto err_cleanup;
> >> + of_node_put(node);
> >
> > This is broken and could potentially lead to a use after free.
> >
> > Specifically, the iteration macro already takes care of putting this
> > reference.
> /**
> * for_each_endpoint_of_node - iterate over every endpoint in a device node
> * @parent: parent device node containing ports and endpoints
> * @child: loop variable pointing to the current endpoint node
> *
> * When breaking out of the loop, of_node_put(child) has to be called manually.
> */
Please read this comment you just pasted here again as it seems you did
not understand it.
> >
> >> + continue;
And again, please remember to trim your replies. Including context after
your reply is almost always wrong.
Johan
prev parent reply other threads:[~2023-07-17 12:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-15 15:37 [PATCH v2] media: camss: Intepret OF graph connections more sensibly Konrad Dybcio
2023-07-17 10:48 ` Johan Hovold
2023-07-17 12:40 ` Konrad Dybcio
2023-07-17 12:45 ` Johan Hovold [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZLU35SucePevwU6i@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=mchehab@kernel.org \
--cc=rfoss@kernel.org \
--cc=todor.too@gmail.com \
--cc=y.oudjana@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox