@@ -125,6 +125,15 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
kobject_name(kobj), kobj, __func__);
return 0;
}
+
+ /* skip remove event, if already sent*/
+ if (action == KOBJ_REMOVE && kobj->state_remove_uevent_sent) {
+ pr_debug("kobject: '%s' (%p): %s: ignoring "
+ "already sent remove event!\n",
+ kobject_name(kobj), kobj, __func__);
+ return 0;
+ }
+
/* skip the event, if the filter returns zero. */
if (uevent_ops && uevent_ops->filter)
if (!uevent_ops->filter(kset, kobj)) {