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

The destructor takes care of the rest.

Sponsored by:	Mellanox Technologies // NVIDIA Networking

(cherry picked from commit 67807f5066)
This commit is contained in:
Hans Petter Selasky 2021-05-11 20:51:35 +02:00
parent 4c4416a098
commit 303bef2a07
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

@ -108,6 +108,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);
@ -2234,7 +2235,7 @@ linux_cdev_static_release(struct kobject *kobj)
kobject_put(kobj->parent);
}
void
static void
linux_destroy_dev(struct linux_cdev *ldev)
{