From: Nathan Lynch Subject: [PATCH 2/8] sysvshm: report error on failure to reattach, avoid crash Date: Tue, 14 Sep 2010 15:02:04 -0500 Message-ID: <1284494530-25946-3-git-send-email-ntl@pobox.com> References: <1284494530-25946-1-git-send-email-ntl@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1284494530-25946-1-git-send-email-ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: containers.vger.kernel.org If ipcshm_restore fails to look up the file object for the region being restored, it should return the error to its caller and not proceed to dereference the file pointer. Signed-off-by: Nathan Lynch --- ipc/shm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ipc/shm.c b/ipc/shm.c index eed4b9a..1ba9193 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -334,7 +334,7 @@ int ipcshm_restore(struct ckpt_ctx *ctx, struct mm_struct *mm, file = ckpt_obj_fetch(ctx, h->ino_objref, CKPT_OBJ_FILE); if (IS_ERR(file)) - PTR_ERR(file); + return PTR_ERR(file); shmid = file->f_dentry->d_inode->i_ino; -- 1.7.2.2