--- zzzz-none-000/linux-5.15.111/lib/kobject_uevent.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/lib/kobject_uevent.c 2024-02-07 10:23:29.000000000 +0000 @@ -55,8 +55,6 @@ [KOBJ_MOVE] = "move", [KOBJ_ONLINE] = "online", [KOBJ_OFFLINE] = "offline", - [KOBJ_BIND] = "bind", - [KOBJ_UNBIND] = "unbind", }; static int kobject_action_type(const char *buf, size_t count, @@ -416,34 +414,6 @@ return ret; } -static void zap_modalias_env(struct kobj_uevent_env *env) -{ - static const char modalias_prefix[] = "MODALIAS="; - size_t len; - int i, j; - - for (i = 0; i < env->envp_idx;) { - if (strncmp(env->envp[i], modalias_prefix, - sizeof(modalias_prefix) - 1)) { - i++; - continue; - } - - len = strlen(env->envp[i]) + 1; - - if (i != env->envp_idx - 1) { - memmove(env->envp[i], env->envp[i + 1], - env->buflen - len); - - for (j = i; j < env->envp_idx - 1; j++) - env->envp[j] = env->envp[j + 1] - len; - } - - env->envp_idx--; - env->buflen -= len; - } -} - /** * kobject_uevent_env - send an uevent with environmental data * @@ -563,25 +533,10 @@ } } - switch (action) { - case KOBJ_ADD: - /* - * Mark "add" event so we can make sure we deliver "remove" - * event to userspace during automatic cleanup. If - * the object did send an "add" event, "remove" will - * automatically generated by the core, if not already done - * by the caller. - */ - kobj->state_add_uevent_sent = 1; - break; - - case KOBJ_UNBIND: - zap_modalias_env(env); - break; - - default: - break; - } + if (action == KOBJ_ADD) + kobj->state_add_uevent_sent = 1; + else if (action == KOBJ_REMOVE) + kobj->state_remove_uevent_sent = 1; mutex_lock(&uevent_sock_mutex); /* we will send an event, so request a new sequence number */