!563 A核 告警清零

Merge pull request !563 from wangchen/a_codex
This commit is contained in:
openharmony_ci 2021-08-21 09:31:56 +00:00 committed by Gitee
commit 8b267dc690
3 changed files with 11 additions and 4 deletions

View File

@ -75,7 +75,7 @@ static void FillFdInfo(struct SeqBuf *seqBuf, struct filelist *fileList, unsigne
} }
if (hasPrivilege) { if (hasPrivilege) {
(void)LosBufPrintf(seqBuf, "%u\t%d\t%6d <%d>\t%s\n", pid, fd, sysFd, filp->f_refcount, name); (void)LosBufPrintf(seqBuf, "%u\t%d\t%6d <%d>\t%s\n", pid, fd, sysFd, filp ? filp->f_refcount : 1, name);
} else { } else {
(void)LosBufPrintf(seqBuf, "%u\t%d\t%s\n", pid, fd, name); (void)LosBufPrintf(seqBuf, "%u\t%d\t%s\n", pid, fd, name);
} }

View File

@ -50,7 +50,10 @@ void CloseOnExec(struct files_struct *files)
if (FD_ISSET(i, files->fdt->proc_fds) && if (FD_ISSET(i, files->fdt->proc_fds) &&
FD_ISSET(i, files->fdt->cloexec_fds)) { FD_ISSET(i, files->fdt->cloexec_fds)) {
sysFd = DisassociateProcessFd(i); sysFd = DisassociateProcessFd(i);
close(sysFd); if (sysFd >= 0) {
close(sysFd);
}
FreeProcessFd(i); FreeProcessFd(i);
} }
} }

View File

@ -265,6 +265,10 @@ static struct Mount* GetDevMountPoint(struct Vnode *dev)
{ {
struct Mount *mnt = NULL; struct Mount *mnt = NULL;
LIST_HEAD *mntList = GetMountList(); LIST_HEAD *mntList = GetMountList();
if (mntList == NULL) {
return NULL;
}
LOS_DL_LIST_FOR_EACH_ENTRY(mnt, mntList, struct Mount, mountList) { LOS_DL_LIST_FOR_EACH_ENTRY(mnt, mntList, struct Mount, mountList) {
if (mnt->vnodeDev == dev) { if (mnt->vnodeDev == dev) {
return mnt; return mnt;
@ -302,7 +306,7 @@ static void FileDisableAndClean(struct Mount *mnt)
{ {
struct filelist *flist = &tg_filelist; struct filelist *flist = &tg_filelist;
struct file *filep = NULL; struct file *filep = NULL;
const struct file_operations_vfs *originOps; const struct file_operations_vfs *originOps = NULL;
for (int i = 3; i < CONFIG_NFILE_DESCRIPTORS; i++) { for (int i = 3; i < CONFIG_NFILE_DESCRIPTORS; i++) {
if (!get_bit(i)) { if (!get_bit(i)) {
@ -355,7 +359,7 @@ static void VnodeTryFreeAll(struct Mount *mount)
int ForceUmountDev(struct Vnode *dev) int ForceUmountDev(struct Vnode *dev)
{ {
int ret; int ret;
struct Vnode *origin; struct Vnode *origin = NULL;
struct filelist *flist = &tg_filelist; struct filelist *flist = &tg_filelist;
if (dev == NULL) { if (dev == NULL) {
return -EINVAL; return -EINVAL;