Received: by 10.192.165.148 with SMTP id m20csp2522351imm; Sun, 22 Apr 2018 08:47:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx48DxkfMiz8sK46QPKUatuUmOAhAR7/ADK+v/LKk2RlMnnDIiWkKL0AhmAbI8nLEjjn3WTVG X-Received: by 10.98.237.17 with SMTP id u17mr16936065pfh.78.1524412036086; Sun, 22 Apr 2018 08:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524412036; cv=none; d=google.com; s=arc-20160816; b=Qd2hbUoUw9eJNIqmKom31ZYBBEkQ1nCAaXZ8f+v1sUGko8zKoXKr34/NQ5Hv1dqlyr Hs7syV5wg4sKw3WjIF9qdLDgQUK3fkW3q8b6Bm58rI/ybZ2fga18xNeQCQIQgSv8iN/h sHQW9ygCb6nIlVyBa3u+kGQtvTW5zpeiXB2BEOdB6rOYlaLSBGFum2e7XuJho9HUrMlB 0b1xpIxFNHwDqA36Zj8QvTwW5UAXxiJJdoB+or31fauzARxzmCRg0S3XNpfwGY/TvCeX 7Pt15uy3BODgkWyy9Hv/eP3KY9/4gFnROoTO2XIGRquu/GUWVwBsz9PTc0NqrX6rf3yw G/LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=WS+oh46CvW2kNK4bIOpc888d2+72QT7bPutoCKgpqVc=; b=vJ+LsF/IBfytkZPxw/hPoyZx36yK8X+wt2mPjtYGKh42ivopFQ6CNiZXQcUQyS/JIE JEpwbDv5Jjj+jNI3WZXJiDoocDdmNpvfTyPCtpYrGsRc318eNTyF8ZrQcN46NdeHc0e3 j6kL5zrW0Jp3GBosY14j/MqGBPAkBurZ6dE3c+yeqFA8ScVLl67Lji0y6WTOsMbPddwx E8372w18NOzEnKExvOpcIas4iP2jzZz2gahWbwhwI6fWzB05rExtdqSpwj9NuhzAnGqM bbpg6lVqR81wIVuNBCs5npxv8AXuDXhrd4pITNYsz1PoupZZKwCeWNLlQj4SdI+MPnMt HVlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si9101954pfe.210.2018.04.22.08.47.01; Sun, 22 Apr 2018 08:47:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754733AbeDVOCq (ORCPT + 99 others); Sun, 22 Apr 2018 10:02:46 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48736 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754865AbeDVOCl (ORCPT ); Sun, 22 Apr 2018 10:02:41 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2737DCDB; Sun, 22 Apr 2018 14:02:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Al Viro Subject: [PATCH 4.16 185/196] jffs2_kill_sb(): deal with failed allocations Date: Sun, 22 Apr 2018 15:53:25 +0200 Message-Id: <20180422135113.819883661@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Al Viro commit c66b23c2840446a82c389e4cb1a12eb2a71fa2e4 upstream. jffs2_fill_super() might fail to allocate jffs2_sb_info; jffs2_kill_sb() must survive that. Cc: stable@kernel.org Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- fs/jffs2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c @@ -342,7 +342,7 @@ static void jffs2_put_super (struct supe static void jffs2_kill_sb(struct super_block *sb) { struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); - if (!sb_rdonly(sb)) + if (c && !sb_rdonly(sb)) jffs2_stop_garbage_collect_thread(c); kill_mtd_super(sb); kfree(c);