Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8097068rwi; Tue, 25 Oct 2022 02:23:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6zOKDRoWke1RLO7Y+kFfY7nx/OneqCOE44gnEYOEKEWG9kjPl5JuHx+xzoS+YkbhUqV4Zb X-Received: by 2002:a05:6402:3213:b0:461:dec8:336d with SMTP id g19-20020a056402321300b00461dec8336dmr6917787eda.221.1666689796970; Tue, 25 Oct 2022 02:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666689796; cv=none; d=google.com; s=arc-20160816; b=P+iTbykRbaXTiEUmO6Q3GQejWiqfkQcf4QVkyMdsYFeddnrR9aOCXaSNI91Cj+WyKz LWRwOfZHxH5MSEt50pwk+Oo299n+NvZf+i4TJLL+p1kWrbMoO82lBMJgZNrOhMKeeTCu 3IgWQg7vuEoOeOno1Bn8eRJeAi1jQKyxtFxPzOVwrvP6S2COqfTknNlZ2MWQebV7EIFB VjTjpIRhcwfWU6+IxPyoy0HwXObghOAOb9n3yvv00nnerXuidgpIQJ3UHBqPQBcXiw2Y AQZQCerihxzWDmHKkWMzWZ3/iEnClsZe6YCVVRQ79Zrr5hDHsNkhJOF+DAitLlirr7qG wm2Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w12-20020a05640234cc00b0044f288e02edsi2513970edc.15.2022.10.25.02.22.51; Tue, 25 Oct 2022 02:23:16 -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 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); -- 2.18.2