coverity: fix parameter_hidden: declaration hides parameter

Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
Adrian Reber 2020-10-13 16:49:35 +00:00 committed by Andrei Vagin
parent 73ed071e05
commit fc20d280c3
3 changed files with 16 additions and 16 deletions

View file

@ -20,9 +20,9 @@ static int nlmsg_receive(char *buf, int len,
if (hdr->nlmsg_seq != CR_NLMSG_SEQ)
continue;
if (hdr->nlmsg_type == NLMSG_DONE) {
int *len = (int *)NLMSG_DATA(hdr);
if (*len < 0)
return err_cb(*len, ns, arg);
int *length = (int *)NLMSG_DATA(hdr);
if (*length < 0)
return err_cb(*length, ns, arg);
return 0;
}
if (hdr->nlmsg_type == NLMSG_ERROR) {

View file

@ -88,11 +88,11 @@ char *mnt_get_sibling_path(struct mount_info *m,
len -= off;
path += off;
} else {
int len = strlen(cut_root);
if (strncmp(rpath, cut_root, len))
int length = strlen(cut_root);
if (strncmp(rpath, cut_root, length))
return NULL;
rpath += strlen(cut_root);
if (len > 0 && (rpath[0] && rpath[0] != '/'))
if (length > 0 && (rpath[0] && rpath[0] != '/'))
return NULL;
}
if (rpath[0] == '/')

View file

@ -674,12 +674,12 @@ static int prepare_pstree_ids(pid_t pid)
leader = pstree_item_by_virt(item->sid);
BUG_ON(leader == NULL);
if (leader->pid->state != TASK_UNDEF) {
pid_t pid;
pid_t helper_pid;
pid = get_free_pid();
if (pid < 0)
helper_pid = get_free_pid();
if (helper_pid < 0)
break;
helper = lookup_create_item(pid);
helper = lookup_create_item(helper_pid);
if (helper == NULL)
return -1;
@ -771,15 +771,15 @@ static int prepare_pstree_ids(pid_t pid)
/* Add a process group leader if it is absent */
for_each_pstree_item(item) {
struct pid *pid;
struct pid *pgid;
if (!item->pgid || vpid(item) == item->pgid)
continue;
pid = pstree_pid_by_virt(item->pgid);
if (pid->state != TASK_UNDEF) {
BUG_ON(pid->state == TASK_THREAD);
rsti(item)->pgrp_leader = pid->item;
pgid = pstree_pid_by_virt(item->pgid);
if (pgid->state != TASK_UNDEF) {
BUG_ON(pgid->state == TASK_THREAD);
rsti(item)->pgrp_leader = pgid->item;
continue;
}
@ -791,7 +791,7 @@ static int prepare_pstree_ids(pid_t pid)
if (current_pgid == item->pgid)
continue;
helper = pid->item;
helper = pgid->item;
helper->sid = item->sid;
helper->pgid = item->pgid;