From patchwork Tue Oct 25 08:47:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 10597 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp890823wru; Tue, 25 Oct 2022 02:05:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6yJvyf7c5I8M9jlEvfY5n9/7/XX3wSNnv4+EE7LaWkWqEuWmJP16k/xLXF+JrEl/DhuWuV X-Received: by 2002:a17:907:2cca:b0:78d:ec48:ac29 with SMTP id hg10-20020a1709072cca00b0078dec48ac29mr31277937ejc.114.1666688737154; Tue, 25 Oct 2022 02:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666688737; cv=none; d=google.com; s=arc-20160816; b=Lta+W68wGoacs5RInFLN+yOORXW/Xu/NpyJQ+43AnRLcGmsg3NtjHKFGRPa5g3Q2Eu U78ENEz+9xp5bfjXpz2ThML7UzmZcDzCmoMhX4DXkaVsda2ypkzqfNK0w2TO9zCrZHFs oR5KSf6gMfXvweWDsN/tcw1Qfotjvn2ooMrOquYAZWh9wJp2EhJyGCbe1B+O6xY3xegT yVvQ8AqPUrg/7Hl6BqVQHBKMVbjph4E2Bb3OndM0ZnUnK4CfhP2OsfDoQQuvlJCTudEk q3KvylEMABpTiHOAVuAmFqtj1OUzNqgjka+gx0JXGusX5Xg5sAOU/zOuf8aLs1iMgicQ WjPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=HXcMX6eNhgCw3ig3qgOtZowgVXeOWn1U5NqqNzlkzv4=; b=D2MBDHfvtxYhSEvE2EOeSPbTsU6zvfhhnmyhxYlI83Ui/ymoBM/+BV3d/tVym4wtRa p0I4jjVlaCPuTk69v6Zm1xARPauZv4mDkCLJpob99+/o0n3B+1wvPl9whhXqIfl7rdK8 DVXb95O1p2lesEX7qJJXKn1R9uuT73sxJAH+4bo74w1Tj3trjh+Uq9FJTrX6XwZyhB3I SB0Y/KcNDA538NAqxgyBpzLHFZpsOnCAiWds4UJhG29k+Nv2xZRDF4fOlN2D7HJNzpj/ 8VEje421Kx5gT95jMBg1aZX93DbcqTH3mE/ciL5YYga92hNzPdJPrQe5pTofoj1jNtMN flMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs35-20020a1709072d2300b00780328a0868si2427664ejc.110.2022.10.25.02.05.11; Tue, 25 Oct 2022 02:05:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231345AbiJYIrU (ORCPT + 99 others); Tue, 25 Oct 2022 04:47:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbiJYIrS (ORCPT ); Tue, 25 Oct 2022 04:47:18 -0400 Received: from mail.nfschina.com (unknown [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A303A2F034; Tue, 25 Oct 2022 01:47:16 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id B12871E80C82; Tue, 25 Oct 2022 16:45:54 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iADYo2F-nhmW; Tue, 25 Oct 2022 16:45:52 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: zeming@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 1AEC41E80C80; Tue, 25 Oct 2022 16:45:52 +0800 (CST) From: Li zeming To: willy@infradead.org, jlayton@kernel.org, song@kernel.org, bvanassche@acm.org, neilb@suse.de Cc: reiserfs-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] reiserfs: journal: Increase jl pointer check Date: Tue, 25 Oct 2022 16:47:04 +0800 Message-Id: <20221025084704.3922-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747649809151412562?= X-GMAIL-MSGID: =?utf-8?q?1747649809151412562?= If kzalloc fails to allocate the jl pointer, NULL is returned directly. Signed-off-by: Li zeming --- fs/reiserfs/journal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 94addfcefede..d64e9de126c1 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -2569,6 +2569,9 @@ static struct reiserfs_journal_list *alloc_journal_list(struct super_block *s) struct reiserfs_journal_list *jl; jl = kzalloc(sizeof(struct reiserfs_journal_list), GFP_NOFS | __GFP_NOFAIL); + if (!jl) + return NULL; + INIT_LIST_HEAD(&jl->j_list); INIT_LIST_HEAD(&jl->j_working_list); INIT_LIST_HEAD(&jl->j_tail_bh_list);