linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/vmalloc: Add check for KMEM_CACHE
Date: Wed, 23 Nov 2022 20:25:37 -0800	[thread overview]
Message-ID: <20221123202537.3378bf960c01f9773f6a4675@linux-foundation.org> (raw)
In-Reply-To: <20221124040226.17953-1-jiasheng@iscas.ac.cn>

On Thu, 24 Nov 2022 12:02:26 +0800 Jiasheng Jiang <jiasheng@iscas.ac.cn> wrote:

> As KMEM_CACHE may return NULL pointer, it should
> be better to check the return value in order to
> avoid NULL pointer dereference in kmem_cache_zalloc.
> 
> ...
>
> @@ -2426,15 +2426,17 @@ void __init vmalloc_init(void)

Linux assumes that allocation attempts from __init code will succeed.

Because if they fail so early in the boot process, the system is so
utterly messed up that we may as well just go oops.



      parent reply	other threads:[~2022-11-24  4:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24  4:02 Jiasheng Jiang
2022-11-24  4:25 ` Matthew Wilcox
2022-11-24  4:25 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221123202537.3378bf960c01f9773f6a4675@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=jiasheng@iscas.ac.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox