提交 d5158cda 编写于 作者: C Chris Lew 提交者: 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: NChris Lew <clew@codeaurora.org>
Signed-off-by: NArun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: NDeepak Kumar Singh <deesin@codeaurora.org>
Link: https://lore.kernel.org/r/1593017121-7953-3-git-send-email-deesin@codeaurora.orgSigned-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
上级 4fcdaf6e
......@@ -81,7 +81,7 @@ EXPORT_SYMBOL(rpmsg_create_ept);
*/
void rpmsg_destroy_ept(struct rpmsg_endpoint *ept)
{
if (ept)
if (ept && ept->ops)
ept->ops->destroy_ept(ept);
}
EXPORT_SYMBOL(rpmsg_destroy_ept);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册