Skip to content

Commit 9c21dae

Browse files
Davidlohr Buesotorvalds
authored andcommitted
ipc/shm: properly return EIDRM in shm_lock()
When getting rid of the general ipc_lock(), this was missed furthermore, making the comment around the ipc object validity check bogus. Under EIDRM conditions, callers will in turn not see the error and continue with the operation. Link: http://lkml.kernel.org/r/20180824030920.GD3677@linux-r8p5 Link: http://lkml.kernel.org/r/20180823024051.GC13343@shao2-debian Fixes: 82061c5 ("ipc: drop ipc_lock()") Signed-off-by: Davidlohr Bueso <[email protected]> Reported-by: kernel test robot <[email protected]> Cc: Manfred Spraul <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 464c7ff commit 9c21dae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ipc/shm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ static inline struct shmid_kernel *shm_lock(struct ipc_namespace *ns, int id)
199199
}
200200

201201
ipc_unlock_object(ipcp);
202+
ipcp = ERR_PTR(-EIDRM);
202203
err:
203204
rcu_read_unlock();
204205
/*

0 commit comments

Comments
 (0)