From: Andrew Morton <akpm@linux-foundation.org>
To: Jackie Liu <liu.yun@linux.dev>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lib: cpu_rmap: reject zero-sized maps
Date: Fri, 17 Jul 2026 21:56:42 -0700 [thread overview]
Message-ID: <20260717215642.9e4b74a29e0b3afa2ee45938@linux-foundation.org> (raw)
In-Reply-To: <20260718042155.31020-1-liu.yun@linux.dev>
On Sat, 18 Jul 2026 12:21:55 +0800 Jackie Liu <liu.yun@linux.dev> wrote:
> From: Jackie Liu <liuyun01@kylinos.cn>
>
> alloc_cpu_rmap() assigns an object index to each possible CPU using
> cpu % size. Passing zero therefore triggers a divide error instead of
> reporting that the map cannot be allocated.
Is there any situation in which this is known to trigger?
> Reject zero along with sizes that do not fit in the u16 map indices.
If passing zero is a caller bug then a divide-by-zero exception is a
fine way of reporting it. So I'm not seeing a need to make any change
here.
next prev parent reply other threads:[~2026-07-18 4:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-18 4:21 Jackie Liu
2026-07-18 4:56 ` Andrew Morton [this message]
2026-07-19 3:36 ` Jackie Liu
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=20260717215642.9e4b74a29e0b3afa2ee45938@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liu.yun@linux.dev \
/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
all inboxes | Powered by JetHome®