From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: xkernel.wang@foxmail.com
Cc: john@phrozen.org, linux-mips@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: lantiq: check the return value of kzalloc()
Date: Wed, 30 Mar 2022 20:34:48 +0200 [thread overview]
Message-ID: <20220330183448.GB18042@alpha.franken.de> (raw)
In-Reply-To: <tencent_3E071B85643888D2C8BF388804334CAE2706@qq.com>
On Fri, Mar 25, 2022 at 07:49:41PM +0800, xkernel.wang@foxmail.com wrote:
> From: Xiaoke Wang <xkernel.wang@foxmail.com>
>
> kzalloc() is a memory allocation function which can return NULL when
> some internal memory errors happen. So it is better to check the
> return value of it to prevent potential wrong memory access or
> memory leak.
>
> Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
> ---
> arch/mips/lantiq/falcon/sysctrl.c | 2 ++
> arch/mips/lantiq/xway/gptu.c | 2 ++
> arch/mips/lantiq/xway/sysctrl.c | 46 ++++++++++++++++++++-----------
> 3 files changed, 34 insertions(+), 16 deletions(-)
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
prev parent reply other threads:[~2022-03-30 19:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-25 11:49 [PATCH] MIPS: lantiq: check the return value of kzalloc() xkernel.wang
2022-03-30 18:34 ` Thomas Bogendoerfer [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=20220330183448.GB18042@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=john@phrozen.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=xkernel.wang@foxmail.com \
/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