linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaud Pouliquen <arnaud.pouliquen@st.com>
To: Chris Lew <clew@codeaurora.org>, <bjorn.andersson@linaro.org>,
	<andy.gross@linaro.org>, <david.brown@linaro.org>,
	<robh+dt@kernel.org>, <mark.rutland@arm.com>
Cc: <aneela@codeaurora.org>, <linux-arm-msm@vger.kernel.org>,
	<linux-remoteproc@vger.kernel.org>, <linux-soc@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 4/6] rpmsg: Guard against null endpoint ops in destroy
Date: Mon, 30 Apr 2018 10:36:08 +0200	[thread overview]
Message-ID: <b328de2b-f1f9-6a10-eb80-b21d4d77acc1@st.com> (raw)
In-Reply-To: <1524783545-21951-5-git-send-email-clew@codeaurora.org>

Hello Chris,

On 04/27/2018 12:59 AM, Chris Lew wrote:
> In RPMSG GLINK the chrdev device will allocate an ept as part of the
> rpdev creation. This device will not register endpoint ops even though
> it has an allocated ept. Protect against the case where the device is
> being destroyed.
> 
> Signed-off-by: Chris Lew <clew@codeaurora.org>
> ---
> 
> Changes since v1:
> - New change
> 
>  drivers/rpmsg/rpmsg_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
> index 920a02f0462c..7bfe36afccc5 100644
> --- a/drivers/rpmsg/rpmsg_core.c
> +++ b/drivers/rpmsg/rpmsg_core.c
> @@ -88,7 +88,7 @@ struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *rpdev,
>   */
>  void rpmsg_destroy_ept(struct rpmsg_endpoint *ept)
>  {
> -	if (ept)
> +	if (ept && ept->ops)
>  		ept->ops->destroy_ept(ept);
>  }
>  EXPORT_SYMBOL(rpmsg_destroy_ept);
> 

Would make sense that you also add test on ept->ops->destroy_ept. I
guess that ops may not be null while destroy_ept pointer is.

Regards
Arnaud

  reply	other threads:[~2018-04-30  8:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26 22:58 [PATCH v3 0/6] Add chrdev and name query support for GLINK Chris Lew
2018-04-26 22:59 ` [PATCH v3 1/6] dt-bindings: soc: qcom: Add label for GLINK bindings Chris Lew
2018-04-27 17:05   ` Rob Herring
2018-04-26 22:59 ` [PATCH v3 2/6] rpmsg: glink: Store edge name for glink device Chris Lew
2018-04-26 22:59 ` [PATCH v3 3/6] rpmsg: glink: Use complete_all for open states Chris Lew
2018-04-26 22:59 ` [PATCH v3 4/6] rpmsg: Guard against null endpoint ops in destroy Chris Lew
2018-04-30  8:36   ` Arnaud Pouliquen [this message]
2018-04-30 11:53     ` Arnaud Pouliquen
2018-04-26 22:59 ` [PATCH v3 5/6] rpmsg: glink: Add support for rpmsg glink chrdev Chris Lew
2018-04-26 22:59 ` [PATCH v3 6/6] rpmsg: glink: Expose rpmsg name attr for glink Chris Lew

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=b328de2b-f1f9-6a10-eb80-b21d4d77acc1@st.com \
    --to=arnaud.pouliquen@st.com \
    --cc=andy.gross@linaro.org \
    --cc=aneela@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=clew@codeaurora.org \
    --cc=david.brown@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).