diff options
author | Chris Lew <[email protected]> | 2020-06-24 22:15:19 +0530 |
---|---|---|
committer | Bjorn Andersson <[email protected]> | 2020-09-15 03:51:03 +0000 |
commit | d5158cda9e7b66fd412815df32e58943b7383f0c (patch) | |
tree | 2fa6b590e6a088a1e064e016dd36db2a1d936394 | |
parent | 4fcdaf6e28d11e2f3820d54dd23cd12a47ddd44e (diff) |
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: Chris Lew <[email protected]>
Signed-off-by: Arun Kumar Neelakantam <[email protected]>
Signed-off-by: Deepak Kumar Singh <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bjorn Andersson <[email protected]>
-rw-r--r-- | drivers/rpmsg/rpmsg_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index a6361cad608b..91de940896e3 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -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); |