@@ -139,6 +139,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
u64 seq;
int i = 0;
int retval = 0;
+ bool delivery_failure;
#ifdef CONFIG_NET
struct uevent_sock *ue_sk;
#endif
@@ -251,6 +252,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
if (retval)
goto exit;
+ delivery_failure = false;
#if defined(CONFIG_NET)
/* send netlink message */
mutex_lock(&uevent_sock_mutex);
@@ -281,14 +283,17 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
0, 1, GFP_KERNEL,
kobj_bcast_filter,
kobj);
- /* ENOBUFS should be handled in userspace */
- if (retval == -ENOBUFS)
+ if (retval == -ESRCH)
retval = 0;
+ else if (retval)
+ delivery_failure = true;
} else
- retval = -ENOMEM;
+ delivery_failure = true;
}
mutex_unlock(&uevent_sock_mutex);
#endif
+ if (delivery_failure)
+ retval = -ENOBUFS;
/* call uevent_helper, usually only enabled during early boot */
if (uevent_helper[0] && !kobj_usermode_filter(kobj)) {