cdev_del() should only put it's kernel object in the LinuxKPI.

The destructor takes care of the rest.

MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
This commit is contained in:
Hans Petter Selasky 2021-05-11 20:51:35 +02:00
parent 904390b478
commit 67807f5066
2 changed files with 2 additions and 5 deletions

View File

@ -135,13 +135,9 @@ cdev_add_ext(struct linux_cdev *cdev, dev_t dev, uid_t uid, gid_t gid, int mode)
return (0);
}
void linux_destroy_dev(struct linux_cdev *);
static inline void
cdev_del(struct linux_cdev *cdev)
{
linux_destroy_dev(cdev);
kobject_put(&cdev->kobj);
}

View File

@ -115,6 +115,7 @@ MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compat");
#undef cdev
#define RB_ROOT(head) (head)->rbh_root
static void linux_destroy_dev(struct linux_cdev *);
static void linux_cdev_deref(struct linux_cdev *ldev);
static struct vm_area_struct *linux_cdev_handle_find(void *handle);
@ -2243,7 +2244,7 @@ linux_cdev_static_release(struct kobject *kobj)
kobject_put(kobj->parent);
}
void
static void
linux_destroy_dev(struct linux_cdev *ldev)
{