mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-28 06:35:34 +07:00
udevd: ignore all messages without DEVPATH
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
This commit is contained in:
parent
88be7e8887
commit
e825b59b07
11
udevd.c
11
udevd.c
@ -313,16 +313,11 @@ static int running_with_devpath(struct uevent_msg *msg, int limit)
|
|||||||
struct uevent_msg *loop_msg;
|
struct uevent_msg *loop_msg;
|
||||||
int childs_count = 0;
|
int childs_count = 0;
|
||||||
|
|
||||||
if (msg->devpath == NULL)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
list_for_each_entry(loop_msg, &running_list, node) {
|
list_for_each_entry(loop_msg, &running_list, node) {
|
||||||
if (limit && childs_count++ > limit) {
|
if (limit && childs_count++ > limit) {
|
||||||
dbg("%llu, maximum number (%i) of child reached", msg->seqnum, childs_count);
|
dbg("%llu, maximum number (%i) of child reached", msg->seqnum, childs_count);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (loop_msg->devpath == NULL)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* return running parent/child device event */
|
/* return running parent/child device event */
|
||||||
if (compare_devpath(loop_msg->devpath, msg->devpath) != 0) {
|
if (compare_devpath(loop_msg->devpath, msg->devpath) != 0) {
|
||||||
@ -431,6 +426,12 @@ static struct uevent_msg *get_msg_from_envbuf(const char *buf, int buf_size)
|
|||||||
msg->envp[i++] = "UDEVD_EVENT=1";
|
msg->envp[i++] = "UDEVD_EVENT=1";
|
||||||
msg->envp[i] = NULL;
|
msg->envp[i] = NULL;
|
||||||
|
|
||||||
|
if (!msg->devpath) {
|
||||||
|
info("DEVPATH missing, ingnore message");
|
||||||
|
free(msg);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user