X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=lib%2Fkobject_uevent.c;h=920a3ca6e2590ddc3d64950a729441758d0a5ce5;hb=e300a63ce4ccec073d254d883a3638d5dca1d771;hp=3f914725bda8ae6b278070b52258940bc4b68489;hpb=5cd2b459d326a424671dcd95f038649f7bf7cb96;p=safe%2Fjmp%2Flinux-2.6 diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 3f91472..920a3ca 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -118,6 +118,13 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, kset = top_kobj->kset; uevent_ops = kset->uevent_ops; + /* skip the event, if uevent_suppress is set*/ + if (kobj->uevent_suppress) { + pr_debug("kobject: '%s' (%p): %s: uevent_suppress " + "caused the event to drop!\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)) { @@ -165,7 +172,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, /* keys passed in from the caller */ if (envp_ext) { for (i = 0; envp_ext[i]; i++) { - retval = add_uevent_var(env, envp_ext[i]); + retval = add_uevent_var(env, "%s", envp_ext[i]); if (retval) goto exit; } @@ -225,8 +232,13 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, } NETLINK_CB(skb).dst_group = 1; - netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL); - } + retval = netlink_broadcast(uevent_sock, skb, 0, 1, + GFP_KERNEL); + /* ENOBUFS should be handled in userspace */ + if (retval == -ENOBUFS) + retval = 0; + } else + retval = -ENOMEM; } #endif @@ -316,7 +328,7 @@ static int __init kobject_uevent_init(void) "kobject_uevent: unable to create netlink socket!\n"); return -ENODEV; } - + netlink_set_nonroot(NETLINK_KOBJECT_UEVENT, NL_NONROOT_RECV); return 0; }