path: root/ipc/util.h
diff options
authorManfred Spraul <>2018-08-21 22:02:04 -0700
committerLinus Torvalds <>2018-08-22 10:52:52 -0700
commit2a9d6481004215da8e93edb588cf448f2af80303 (patch)
tree8ce2a97df46ba44963cbc517f58707fc1ee7eb4d /ipc/util.h
parent27c331a174614208d0b539019583990967ad9479 (diff)
ipc/util.c: update return value of ipc_getref from int to bool
ipc_getref has still a return value of type "int", matching the atomic_t interface of atomic_inc_not_zero()/atomic_add_unless(). ipc_getref now uses refcount_inc_not_zero, which has a return value of type "bool". Therefore, update the return code to avoid implicit conversions. Link: Signed-off-by: Manfred Spraul <> Cc: Davidlohr Bueso <> Cc: Davidlohr Bueso <> Cc: Dmitry Vyukov <> Cc: Herbert Xu <> Cc: Kees Cook <> Cc: Michael Kerrisk <> Cc: Michal Hocko <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'ipc/util.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/util.h b/ipc/util.h
index e74564fe3375..0a159f69b3bb 100644
--- a/ipc/util.h
+++ b/ipc/util.h
@@ -138,7 +138,7 @@ static inline int ipc_get_maxidx(struct ipc_ids *ids)
* refcount is initialized by ipc_addid(), before that point call_rcu()
* must be used.
-int ipc_rcu_getref(struct kern_ipc_perm *ptr);
+bool ipc_rcu_getref(struct kern_ipc_perm *ptr);
void ipc_rcu_putref(struct kern_ipc_perm *ptr,
void (*func)(struct rcu_head *head));