From 8ce4bb38fece4f9e18b49a3697c80a08380dca34 Mon Sep 17 00:00:00 2001 From: sun_fan Date: Wed, 25 Aug 2021 12:38:18 +0800 Subject: [PATCH] init: fix init bugs Signed-off-by: sun_fan --- services/etc/init.cfg | 2 +- services/src/uevent.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/services/etc/init.cfg b/services/etc/init.cfg index 080a5a3a..5d82483e 100755 --- a/services/etc/init.cfg +++ b/services/etc/init.cfg @@ -96,7 +96,7 @@ "write /proc/sys/kernel/sched_child_runs_first 0", "write /proc/sys/kernel/randomize_va_space 2", "write /proc/sys/vm/mmap_min_addr 32768", - "write /proc/sys/net/ipv4/ping_group_range \"0 2147483647\"", + "write /proc/sys/net/ipv4/ping_group_range 0 2147483647", "write /proc/sys/net/unix/max_dgram_qlen 600", "write /proc/sys/kernel/sched_rt_runtime_us 950000", "write /proc/sys/kernel/sched_rt_period_us 1000000", diff --git a/services/src/uevent.c b/services/src/uevent.c index ece9e1f6..7e741259 100644 --- a/services/src/uevent.c +++ b/services/src/uevent.c @@ -646,6 +646,9 @@ static const char *ParseDeviceName(const struct Uevent *uevent, unsigned int len if ((uevent->major < 0) || (uevent->minor < 0)) { return NULL; } + if (uevent->deviceName == NULL || uevent->deviceName[0] == '\0') { + return NULL; + } /* do we have a name? */ const char *name = strrchr(uevent->path, '/'); if (!name) { -- GitLab