Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4500737pxb; Tue, 25 Jan 2022 11:43:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQSHPM5fhzcYnYbz/q6vipjVpLuwI7DalabbJkRjcUkKFP5tLPSReYway0NeJLdFmUTCYL X-Received: by 2002:a05:6402:95e:: with SMTP id h30mr18645392edz.209.1643139821224; Tue, 25 Jan 2022 11:43:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643139821; cv=none; d=google.com; s=arc-20160816; b=cTVxP6O+eWXTSaG/jV8w6gudWMk2k3y1/4CPprQo9V/KhG/y4Du4C/9rYYBGk0wvdD 8BpVeZBj7F6ylOHYa5sPJ8hOzzHaP6tngqCVl7H1XNYEhiyOtVLjteOzT4+O5frnM/Li OFYNxvkbagSQEP+y07dAwFTUVvajly40AX6i0F1E9hxCKRKexbZQXYIXaBtB9eh7yk6g yY1bQsBiDRTKCUPcRo34H1FLEjq4NRin7EkRrWLPJmt5oIAOhjQZhKKKDUKU7JPZdiam aEiPBvB59y75kWIdVUrKCSC70pEp/NWRxk9BF4Kh3hYY8yclXU/OFJUmO/uGzJBWdvIv FBiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yYJzBr/Gnzr1F/U/C/od8YhWfQek25WEk/n1vGgEdv8=; b=W78/BalZo/IS1GNGJWmkkm/EDd/ZdPMXhFY6+wFPyjZA68E+GQGuzMn4pyUz9uJcdG DEIb7DVDYtOd++nEfdD4DlCZIfWsxGUMxU9vwXRq3kCh8jQ9xw7krCws10cEd0ZTNy9h 6QusE122s4/poRQxa5nok3NsrnRjbO95hynjeWXle7wxDsMWNqkoSZUy5wEqqnggmGwy IS6WdqRutuTymsPeDZ886vURd3c/a96IWDsIMtnEluR+qlvRFS8+FFSEjRkgDxj/8z4P o2zeMVt/VCVLZ+uc5qAXyLdnNvc/RJr7bL1jf8rZSabcfxicWR9844i3JOLmRnn1FryS 2DbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U0WpCFHo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n9si757942edx.625.2022.01.25.11.43.13; Tue, 25 Jan 2022 11:43:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U0WpCFHo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384739AbiAYNjX (ORCPT + 99 others); Tue, 25 Jan 2022 08:39:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:23043 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382470AbiAYNgT (ORCPT ); Tue, 25 Jan 2022 08:36:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643117774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yYJzBr/Gnzr1F/U/C/od8YhWfQek25WEk/n1vGgEdv8=; b=U0WpCFHo/tcg2g8Rn6IyOCSN9l2uX6AcvXYjdEuWUZR1G/mF/S2yYyZy4Rj06J/8lLKEOq H+B+XYsMBgXJQgt1xPkEHUEsDpx8XbEfg9hxK7p58RXPQEt3Eb0BJCrqhGwVSrQQgKGNk6 J4inqAwlntehZ1FJqyOQDK8D4MVT++M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-659-PHbuR-4wMraAXPpE8XR5Ow-1; Tue, 25 Jan 2022 08:36:13 -0500 X-MC-Unique: PHbuR-4wMraAXPpE8XR5Ow-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E68926409A; Tue, 25 Jan 2022 13:36:11 +0000 (UTC) Received: from work (unknown [10.40.194.155]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 91EDA7BB5E; Tue, 25 Jan 2022 13:36:10 +0000 (UTC) Date: Tue, 25 Jan 2022 14:36:07 +0100 From: Lukas Czerner To: Ameer Hamza Cc: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ext4: handle unsuccessful sbi allocation Message-ID: <20220125133607.hioap2ggmiodmgr5@work> References: <20220125130604.26473-1-amhamza.mgc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220125130604.26473-1-amhamza.mgc@gmail.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We already have a patch to fix the problem on this list https://lore.kernel.org/linux-ext4/20220119130209.40112-1-lczerner@redhat.com/T/#u -Lukas On Tue, Jan 25, 2022 at 06:06:04PM +0500, Ameer Hamza wrote: > Move to common fail path in case of unsuccessful sbi allocation > > Addresses-Coverity: 1497833 ("Unused value") > > Signed-off-by: Ameer Hamza > --- > fs/ext4/super.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index 57914acc5402..0dccf1ed931b 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -5540,8 +5540,10 @@ static int ext4_fill_super(struct super_block *sb, struct fs_context *fc) > int ret; > > sbi = ext4_alloc_sbi(sb); > - if (!sbi) > + if (!sbi) { > ret = -ENOMEM; > + goto free_sbi; > + } > > fc->s_fs_info = sbi; > > -- > 2.25.1 >