Quoting Matthias Kaehlcke (2022-01-10 10:47:37) > struct rpmsg_eptdev contains a struct cdev. The current code frees > the rpmsg_eptdev struct in rpmsg_eptdev_destroy(), but the cdev is > a managed object, therefore its release is not predictable and the > rpmsg_eptdev could be freed before the cdev is entirely released. > > The cdev_device_add/del() API was created to address this issue > (see commit 233ed09d7fda), use it instead of cdev add/del(). > > Fixes: c0cdc19f84a4 ("rpmsg: Driver for user space endpoint interface") > Suggested-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx> > Signed-off-by: Matthias Kaehlcke <mka@xxxxxxxxxxxx> > Reviewed-by: Mathieu Poirier <mathieu.poirier@xxxxxxxxxx> > --- Reviewed-by: Stephen Boyd <swboyd@xxxxxxxxxxxx>