Message ID | 20210330104351.21328-4-s.hauer@pengutronix.de |
---|---|
State | Under Review |
Delegated to: | Richard Weinberger |
Headers | show
Return-Path: <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=cmBN90Vk; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F8mNv1jb1z9sRK for <incoming@patchwork.ozlabs.org>; Tue, 30 Mar 2021 21:47:27 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=H0+H//+fpF5tMhRbqVF5W4tiBr4xd3AkjDGV/scTXs0=; b=cmBN90VkkaksphH6M3Z0mVcKr B+0JKqJ1ndUUmw0ic+MyUTDYHWcV+bADmdX8T9+z3KHxvNZ/BnVuezKwAT3Kg/lk4XOS47o0x5eUs H4qndy2NpqSfe9dM1tDEzJMPTWub3prL22QyZXcH4jwmTav/tiIhNxfMBxlJjsh8Ii9++tsqLoAR0 xDzgPXI+d0KFYtSM5A5tUPTOMabv4OqJoF/GjpTeV8esvdDyuKDNjGN7W+4/B1KyZRNjah4vV1A87 xeZHe2zsY28JGRMdlqyIHy1liXZwrJuvqzu6wgfw3g6e/OvoLixnIDRTsglok26OL5xOMI5Hkqjug Td2u6sPUA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRBtZ-003S0L-AF; Tue, 30 Mar 2021 10:46:49 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRBr3-003REn-Cu for linux-mtd@lists.infradead.org; Tue, 30 Mar 2021 10:45:04 +0000 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <sha@pengutronix.de>) id 1lRBqu-0006SK-NT; Tue, 30 Mar 2021 12:44:04 +0200 Received: from sha by dude02.hi.pengutronix.de with local (Exim 4.92) (envelope-from <sha@pengutronix.de>) id 1lRBqt-0006Of-RQ; Tue, 30 Mar 2021 12:44:03 +0200 From: Sascha Hauer <s.hauer@pengutronix.de> To: linux-mtd@lists.infradead.org Cc: kernel@pengutronix.de, Jan Kara <jack@suse.com>, Richard Weinberger <richard@nod.at>, Sascha Hauer <s.hauer@pengutronix.de> Subject: [PATCH 3/7] ubifs: do not call ubifs_inode() on unchecked pointer Date: Tue, 30 Mar 2021 12:43:47 +0200 Message-Id: <20210330104351.21328-4-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210330104351.21328-1-s.hauer@pengutronix.de> References: <20210330104351.21328-1-s.hauer@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mtd@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210330_114413_857780_BC314A49 X-CRM114-Status: GOOD ( 13.56 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: new_inode() may return NULL, so only derefence the return inode when it's non NULL. This is merely a cleanup as calling ubifs_inode() on a NULL pointer doesn't do any harm, only using the result would [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list <linux-mtd.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-mtd/> List-Post: <mailto:linux-mtd@lists.infradead.org> List-Help: <mailto:linux-mtd-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org> Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
Add quota support to UBIFS
|
expand
|
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index d9d8d7794eff..ba4944c87a2c 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -82,10 +82,10 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, struct inode *dir, bool encrypted = false; inode = new_inode(c->vfs_sb); - ui = ubifs_inode(inode); if (!inode) return ERR_PTR(-ENOMEM); + ui = ubifs_inode(inode); /* * Set 'S_NOCMTIME' to prevent VFS form updating [mc]time of inodes and * marking them dirty in file write path (see 'file_update_time()').
new_inode() may return NULL, so only derefence the return inode when it's non NULL. This is merely a cleanup as calling ubifs_inode() on a NULL pointer doesn't do any harm, only using the result would. Nevertheless using inode only after it has been checked for validity looks much cleaner. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- fs/ubifs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)