提交 a0aff5e0 编写于 作者: Z zhong_ning

fix codestyle

上级 3b1104c5
......@@ -42,6 +42,7 @@
#define LOADCFG_MAX_FILE_LEN 51200 // loadcfg, max file size is 50K
#define LOADCFG_MAX_LOOP 20 // loadcfg, to prevent to be trapped in infite loop
#define OCTAL_TYPE 8 // 8 means octal to decimal
#define MAX_BUFFER 256
static const char *g_supportCfg[] = {
"/patch/fstab.cfg",
};
......@@ -347,14 +348,15 @@ static void DoInsmodInternal(const char *fileName, char *secondPtr, char *restPt
if (!fileName) {
return;
}
char *realPath = NULL;
realPath = realpath(fileName, realPath);
char *realPath = (char *)calloc(MAX_BUFFER, sizeof(char));
if (realPath == NULL) {
return;
}
realPath = realpath(fileName, realPath);
int fd = open(realPath, O_RDONLY | O_NOFOLLOW | O_CLOEXEC);
if (fd < 0) {
printf("[Init] failed to open %s: %d\n", realPath, errno);
free(realPath);
return;
}
int rc = syscall(__NR_finit_module, fd, options, flags);
......@@ -364,6 +366,7 @@ static void DoInsmodInternal(const char *fileName, char *secondPtr, char *restPt
if (fd >= 0) {
close(fd);
}
free(realPath);
return;
}
......
......@@ -616,7 +616,7 @@ static char **GetCharacterDeviceSymlinks(const struct Uevent *uevent)
}
if (strncmp(parent, "/usb", DEV_USB)) {
goto err;
goto err;
}
/* skip root hub name and device. use device interface */
if (!*parent) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册