From e05bd4f511fa685baab09610abc5b67d6808bd86 Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Sat, 25 Dec 2021 16:21:08 +0800 Subject: [PATCH] init: fix bugs Signed-off-by: xionglei6 --- ueventd/ueventd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ueventd/ueventd.c b/ueventd/ueventd.c index 926c324..17e20c9 100755 --- a/ueventd/ueventd.c +++ b/ueventd/ueventd.c @@ -133,13 +133,13 @@ static void HandleUeventRequired(const struct Uevent *uevent, char **devices, in if (uevent->partitionName == NULL) { INIT_LOGI("Match with %s for %s", devices[i], uevent->syspath); deviceName = strstr(devices[i], "/dev/block"); - INIT_INFO_CHECK(deviceName != NULL, continue, - "device %s not match \"/dev/block\".", devices[i]); - deviceName += sizeof("/dev/block") - 1; - INIT_INFO_CHECK(strstr(uevent->syspath, deviceName) != NULL, continue, - "uevent->syspath %s not match deviceName %s", uevent->syspath, deviceName); - HandleBlockDeviceEvent(uevent); - break; + if (deviceName != NULL) { + deviceName += sizeof("/dev/block") - 1; + if (strstr(uevent->syspath, deviceName) != NULL) { + HandleBlockDeviceEvent(uevent); + break; + } + } } else if (strstr(devices[i], uevent->partitionName) != NULL) { INIT_LOGI("Handle block device partitionName %s", uevent->partitionName); HandleBlockDeviceEvent(uevent);