From nobody Wed Apr 8 10:03:21 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85AA9C04A95 for ; Tue, 25 Oct 2022 08:47:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231324AbiJYIrV (ORCPT ); Tue, 25 Oct 2022 04:47:21 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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_li= st(struct super_block *s) struct reiserfs_journal_list *jl; jl =3D 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); --=20 2.18.2