linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Lew <clew@codeaurora.org>
To: 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,
	clew@codeaurora.org
Subject: [PATCH v3 4/6] rpmsg: Guard against null endpoint ops in destroy
Date: Thu, 26 Apr 2018 15:59:03 -0700	[thread overview]
Message-ID: <1524783545-21951-5-git-send-email-clew@codeaurora.org> (raw)
In-Reply-To: <1524783545-21951-1-git-send-email-clew@codeaurora.org>

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);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

  parent reply	other threads:[~2018-04-26 23:00 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 ` Chris Lew [this message]
2018-04-30  8:36   ` [PATCH v3 4/6] rpmsg: Guard against null endpoint ops in destroy Arnaud Pouliquen
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=1524783545-21951-5-git-send-email-clew@codeaurora.org \
    --to=clew@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=aneela@codeaurora.org \
    --cc=bjorn.andersson@linaro.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).