Skip to content

rpmsg_ept_decref #659

@Leo9409

Description

@Leo9409

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions