]> Git Repo - linux.git/commitdiff
rpmsg: Guard against null endpoint ops in destroy
authorChris Lew <[email protected]>
Wed, 24 Jun 2020 16:45:19 +0000 (22:15 +0530)
committerBjorn Andersson <[email protected]>
Tue, 15 Sep 2020 03:51:03 +0000 (03:51 +0000)
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]>
drivers/rpmsg/rpmsg_core.c

index a6361cad608b1c811dc8fa4a523259162e7c978c..91de940896e3d03170b8f0661ac0d5abd1883711 100644 (file)
@@ -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);
This page took 0.057775 seconds and 4 git commands to generate.