-
Notifications
You must be signed in to change notification settings - Fork 318
Open
Labels
Description
When I was running rpmsg_unregister_endpoint, I found that rpmsg_ept_decref reported an error, and the ept->release_cb pointer was an abnormal value.
Ifrelease_cbis not initialized, it is not 0 in some cases, resulting in an error in calling the callback function pointer. So add ept->release_cb = NULL in rpmsg_register_endpoint function; Would it be better?
void rpmsg_register_endpoint(struct rpmsg_device *rdev,
struct rpmsg_endpoint *ept,
const char *name,
uint32_t src, uint32_t dest,
rpmsg_ept_cb cb,
rpmsg_ns_unbind_cb ns_unbind_cb, void *priv)
{
if (name)
(void)safe_strcpy(ept->name, sizeof(ept->name), name, RPMSG_NAME_SIZE);
else
ept->name[0] = 0;
ept->refcnt = 1;
ept->addr = src;
ept->dest_addr = dest;
ept->cb = cb;
ept->ns_unbind_cb = ns_unbind_cb;
ept->priv = priv;
ept->rdev = rdev;
ept->release_cb = NULL;
metal_list_add_tail(&rdev->endpoints, &ept->node);
}