Commit d5158cda authored by Chris Lew's avatar Chris Lew Committed by Bjorn Andersson

rpmsg: Guard against null endpoint ops in destroy

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: default avatarChris Lew <clew@codeaurora.org>
Signed-off-by: default avatarArun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: default avatarDeepak Kumar Singh <deesin@codeaurora.org>
Link: https://lore.kernel.org/r/1593017121-7953-3-git-send-email-deesin@codeaurora.orgSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 4fcdaf6e
...@@ -81,7 +81,7 @@ EXPORT_SYMBOL(rpmsg_create_ept); ...@@ -81,7 +81,7 @@ EXPORT_SYMBOL(rpmsg_create_ept);
*/ */
void rpmsg_destroy_ept(struct rpmsg_endpoint *ept) void rpmsg_destroy_ept(struct rpmsg_endpoint *ept)
{ {
if (ept) if (ept && ept->ops)
ept->ops->destroy_ept(ept); ept->ops->destroy_ept(ept);
} }
EXPORT_SYMBOL(rpmsg_destroy_ept); EXPORT_SYMBOL(rpmsg_destroy_ept);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment