Received: by 10.192.165.148 with SMTP id m20csp2458221imm; Sun, 22 Apr 2018 07:27:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+i2X/ziTQEDzZpxlVUUzOimdPEdkgSqqbt1lVCKKibY47YKnohmf0OxAkybDUrH40026ss X-Received: by 10.98.10.131 with SMTP id 3mr16524369pfk.112.1524407271725; Sun, 22 Apr 2018 07:27:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524407271; cv=none; d=google.com; s=arc-20160816; b=cawmtYwaSglRwr5Nv9p5pa75Pr8v14V0lHOf8pmjyMLiohBJQHZiVJvnQp43szXe+B 0fyzNfEaYmorunMsKQ3Gqy3mTBagqBwvcomvVTdHY8LEAsm52N9xJh8OQiaJ1FdoYijp RpbbJOfoLAd0VgJQcljonJeuk154kc+e0RquFXZAQzwtDQwkKAx04MCh9TO4HGBvEikb cn05DFXwbAam7TRjEPpGAbCMS3vcHBdl0C/l0xDC3Sohzb8e1btkdYH/VZg9iUDDmXVf G0quJHC9cYVp70DvYprCPzefq/Aw+vhkCMwHxc/6k9udpQj1nwnb2nSKNMeZonGKxYqT AL0g== 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=2q/eBLDsTKLT76xBZm3K9VuJj/7wUNlTXB9EtiYK5WU=; b=Hf4w6FSBNAFl/PLhZ38R5CfCwPc7wUHVbN0O3jmGs7CoXof4aW8DHdtHeINgZ/YnDb 98WWkL7Izn0PG84W2BzCp+Db0IPYgpJit575foQaGBHRxsvDXR79Psqj4rqcDmjU3yFT S4TGuXL6juwOyEGms4VO0zAy48lsTrV3/mIwDdtMjahPpodMTBoXNnXkC25doBLE0j+D iNzi6lGrYtCX6grVttTy/HL3Yv2YEp8p3/88a8foajYqs+Y6jzW/nC7Zvd4wlcQDHLBp J6/38Wsj/6/iqGpRB+1BTlu5Vs8X/HY7YvvcbkNxLNygDXxXK9tQirqpVtHL1E1D1k8K KNsA== 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 l14si8297917pgs.319.2018.04.22.07.27.15; Sun, 22 Apr 2018 07:27:51 -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 S1757624AbeDVOVw (ORCPT + 99 others); Sun, 22 Apr 2018 10:21:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33038 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756330AbeDVOVp (ORCPT ); Sun, 22 Apr 2018 10:21:45 -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 E863F98C; Sun, 22 Apr 2018 14:21:44 +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 3.18 47/52] jffs2_kill_sb(): deal with failed allocations Date: Sun, 22 Apr 2018 15:54:20 +0200 Message-Id: <20180422135317.515847428@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135315.254787616@linuxfoundation.org> References: <20180422135315.254787616@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 3.18-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 @@ -345,7 +345,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->s_flags & MS_RDONLY)) + if (c && !(sb->s_flags & MS_RDONLY)) jffs2_stop_garbage_collect_thread(c); kill_mtd_super(sb); kfree(c);