From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757362AbaDXVyl (ORCPT ); Thu, 24 Apr 2014 17:54:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39907 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757130AbaDXVxX (ORCPT ); Thu, 24 Apr 2014 17:53:23 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Zefan , David Woodhouse , Artem Bityutskiy , Andrew Morton , Brian Norris Subject: [PATCH 3.4 26/27] jffs2: remove from wait queue after schedule() Date: Thu, 24 Apr 2014 14:56:00 -0700 Message-Id: <20140424215552.760255639@linuxfoundation.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <20140424215551.942390050@linuxfoundation.org> References: <20140424215551.942390050@linuxfoundation.org> User-Agent: quilt/0.61-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Li Zefan commit 3ead9578443b66ddb3d50ed4f53af8a0c0298ec5 upstream. @wait is a local variable, so if we don't remove it from the wait queue list, later wake_up() may end up accessing invalid memory. This was spotted by eyes. Signed-off-by: Li Zefan Cc: David Woodhouse Cc: Artem Bityutskiy Signed-off-by: Andrew Morton Signed-off-by: Brian Norris Signed-off-by: Greg Kroah-Hartman --- fs/jffs2/nodemgmt.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/jffs2/nodemgmt.c +++ b/fs/jffs2/nodemgmt.c @@ -139,6 +139,7 @@ int jffs2_reserve_space(struct jffs2_sb_ spin_unlock(&c->erase_completion_lock); schedule(); + remove_wait_queue(&c->erase_wait, &wait); } else spin_unlock(&c->erase_completion_lock); } else if (ret)