git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
inflate_fast: sout is already a short so ptr arith was off by one.
[safe/jmp/linux-2.6]
/
lib
/
kobject_uevent.c
diff --git
a/lib/kobject_uevent.c
b/lib/kobject_uevent.c
index
318328d
..
c9d3a3e
100644
(file)
--- a/
lib/kobject_uevent.c
+++ b/
lib/kobject_uevent.c
@@
-95,7
+95,7
@@
int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
const char *subsystem;
struct kobject *top_kobj;
struct kset *kset;
const char *subsystem;
struct kobject *top_kobj;
struct kset *kset;
- struct kset_uevent_ops *uevent_ops;
+
const
struct kset_uevent_ops *uevent_ops;
u64 seq;
int i = 0;
int retval = 0;
u64 seq;
int i = 0;
int retval = 0;
@@
-118,6
+118,13
@@
int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
kset = top_kobj->kset;
uevent_ops = kset->uevent_ops;
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)) {
/* skip the event, if the filter returns zero. */
if (uevent_ops && uevent_ops->filter)
if (!uevent_ops->filter(kset, kobj)) {
@@
-227,6
+234,9
@@
int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
NETLINK_CB(skb).dst_group = 1;
retval = netlink_broadcast(uevent_sock, skb, 0, 1,
GFP_KERNEL);
NETLINK_CB(skb).dst_group = 1;
retval = netlink_broadcast(uevent_sock, skb, 0, 1,
GFP_KERNEL);
+ /* ENOBUFS should be handled in userspace */
+ if (retval == -ENOBUFS)
+ retval = 0;
} else
retval = -ENOMEM;
}
} else
retval = -ENOMEM;
}
@@
-318,7
+328,7
@@
static int __init kobject_uevent_init(void)
"kobject_uevent: unable to create netlink socket!\n");
return -ENODEV;
}
"kobject_uevent: unable to create netlink socket!\n");
return -ENODEV;
}
-
+ netlink_set_nonroot(NETLINK_KOBJECT_UEVENT, NL_NONROOT_RECV);
return 0;
}
return 0;
}