PM: resolve Coverity warnings
This commit is contained in:
parent
aa5531fc67
commit
be87fdda3d
@ -47,7 +47,7 @@ int do_fork()
|
|||||||
register struct mproc *rmp; /* pointer to parent */
|
register struct mproc *rmp; /* pointer to parent */
|
||||||
register struct mproc *rmc; /* pointer to child */
|
register struct mproc *rmc; /* pointer to child */
|
||||||
pid_t new_pid;
|
pid_t new_pid;
|
||||||
static int next_child = 0;
|
static unsigned int next_child = 0;
|
||||||
int i, n = 0, s;
|
int i, n = 0, s;
|
||||||
endpoint_t child_ep;
|
endpoint_t child_ep;
|
||||||
message m;
|
message m;
|
||||||
@ -70,8 +70,7 @@ int do_fork()
|
|||||||
} while((mproc[next_child].mp_flags & IN_USE) && n <= NR_PROCS);
|
} while((mproc[next_child].mp_flags & IN_USE) && n <= NR_PROCS);
|
||||||
if(n > NR_PROCS)
|
if(n > NR_PROCS)
|
||||||
panic("do_fork can't find child slot");
|
panic("do_fork can't find child slot");
|
||||||
if(next_child < 0 || next_child >= NR_PROCS
|
if(next_child >= NR_PROCS || (mproc[next_child].mp_flags & IN_USE))
|
||||||
|| (mproc[next_child].mp_flags & IN_USE))
|
|
||||||
panic("do_fork finds wrong child slot: %d", next_child);
|
panic("do_fork finds wrong child slot: %d", next_child);
|
||||||
|
|
||||||
/* Memory part of the forking. */
|
/* Memory part of the forking. */
|
||||||
@ -146,7 +145,7 @@ int do_srv_fork()
|
|||||||
register struct mproc *rmc; /* pointer to child */
|
register struct mproc *rmc; /* pointer to child */
|
||||||
int s;
|
int s;
|
||||||
pid_t new_pid;
|
pid_t new_pid;
|
||||||
static int next_child = 0;
|
static unsigned int next_child = 0;
|
||||||
int i, n = 0;
|
int i, n = 0;
|
||||||
endpoint_t child_ep;
|
endpoint_t child_ep;
|
||||||
message m;
|
message m;
|
||||||
@ -173,8 +172,7 @@ int do_srv_fork()
|
|||||||
} while((mproc[next_child].mp_flags & IN_USE) && n <= NR_PROCS);
|
} while((mproc[next_child].mp_flags & IN_USE) && n <= NR_PROCS);
|
||||||
if(n > NR_PROCS)
|
if(n > NR_PROCS)
|
||||||
panic("do_fork can't find child slot");
|
panic("do_fork can't find child slot");
|
||||||
if(next_child < 0 || next_child >= NR_PROCS
|
if(next_child >= NR_PROCS || (mproc[next_child].mp_flags & IN_USE))
|
||||||
|| (mproc[next_child].mp_flags & IN_USE))
|
|
||||||
panic("do_fork finds wrong child slot: %d", next_child);
|
panic("do_fork finds wrong child slot: %d", next_child);
|
||||||
|
|
||||||
if((s=vm_fork(rmp->mp_endpoint, next_child, &child_ep)) != OK) {
|
if((s=vm_fork(rmp->mp_endpoint, next_child, &child_ep)) != OK) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user