kernel/lib/kobject.c
.. .. @@ -874,6 +874,11 @@ 874 874 if (!k) 875 875 return -EINVAL; 876 876 877 + if (!k->kobj.ktype) {878 + pr_err("must have a ktype to be initialized properly!\n");879 + return -EINVAL;880 + }881 +877 882 kset_init(k); 878 883 err = kobject_add_internal(&k->kobj); 879 884 if (err)