summaryrefslogtreecommitdiff
path: root/ipc/util.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-18 07:55:55 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-18 07:55:55 +0200
commit48a789079a146ecd916e29cc5e47410d9cb05fbe (patch)
tree04f890f10e9cbdd97b4bf72647656ec94cb8d51f /ipc/util.c
parent2478be82de44bee4346eb1f48d4cfa28cd99d2d0 (diff)
parentb9bbe6ed63b2b9f2c9ee5cbd0f2c946a2723f4ce (diff)
Merge 5.7-rc6 into usb-next
We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'ipc/util.c')
-rw-r--r--ipc/util.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ipc/util.c b/ipc/util.c
index 7acccfded7cb..cfa0045e748d 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -764,21 +764,21 @@ static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos,
total++;
}
- *new_pos = pos + 1;
+ ipc = NULL;
if (total >= ids->in_use)
- return NULL;
+ goto out;
for (; pos < ipc_mni; pos++) {
ipc = idr_find(&ids->ipcs_idr, pos);
if (ipc != NULL) {
rcu_read_lock();
ipc_lock_object(ipc);
- return ipc;
+ break;
}
}
-
- /* Out of range - return NULL to terminate iteration */
- return NULL;
+out:
+ *new_pos = pos + 1;
+ return ipc;
}
static void *sysvipc_proc_next(struct seq_file *s, void *it, loff_t *pos)