diff --git a/drivers/misc/rpmsgdev_server.c b/drivers/misc/rpmsgdev_server.c index 0e5b214849..9df1066830 100644 --- a/drivers/misc/rpmsgdev_server.c +++ b/drivers/misc/rpmsgdev_server.c @@ -403,6 +403,7 @@ static void rpmsgdev_ns_bind(FAR struct rpmsg_device *rdev, rpmsgdev_ept_cb, rpmsgdev_ns_unbind); if (ret < 0) { + nxmutex_destroy(&server->lock); kmm_free(server); } }