From: Davidlohr Bueso Date: Tue, 4 Sep 2018 22:46:02 +0000 (-0700) Subject: ipc/shm: properly return EIDRM in shm_lock() X-Git-Tag: v4.19~240^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9c21dae291d1b7763b749dfaef3fb911286c0d98;p=platform%2Fkernel%2Flinux-rpi.git 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: 82061c57ce9 ("ipc: drop ipc_lock()") Signed-off-by: Davidlohr Bueso Reported-by: kernel test robot Cc: Manfred Spraul Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/ipc/shm.c b/ipc/shm.c index b0eb375..4cd402e 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -199,6 +199,7 @@ static inline struct shmid_kernel *shm_lock(struct ipc_namespace *ns, int id) } ipc_unlock_object(ipcp); + ipcp = ERR_PTR(-EIDRM); err: rcu_read_unlock(); /*