mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: Markus Elfring <Markus.Elfring@web.de>,
	Zhu Jun <zhujun2@cmss.chinamobile.com>,
	linux-mm@kvack.org, kernel-janitors@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tools/mm: Use calloc and check the potential memory allocation failure
Date: Thu, 29 Aug 2024 13:09:58 +0530	[thread overview]
Message-ID: <37577635-89c9-4afe-a30d-add02c0eb896@arm.com> (raw)
In-Reply-To: <716f7466-562d-4bbe-a8ec-851a0b289db5@web.de>


On 8/29/24 11:55, Markus Elfring wrote:
>> Replace malloc with calloc and add memory allocating check
>                        memset(…, 0, …) call by calloc()?

Calloc returns zeroed-out memory.

>
>
>> of comm_str before used.
> * Add also a null pointer check for the detection of a memory allocation failure.

Which is exactly what Zhu has done?

>
> * Would you like to improve such a change description another bit
>    (with tags like “Fixes” and “Cc”)?
>
> * How do you think about to omit the statement “fprintf(stderr, "Out of memory\n");”?

Why?

>
> * I suggest to omit the word “potential” from the summary phrase.
>
>
> Regards,
> Markus
>

  reply	other threads:[~2024-08-29  7:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29  5:56 Zhu Jun
2024-08-29  6:25 ` Markus Elfring
2024-08-29  7:39   ` Dev Jain [this message]
2024-08-29  7:55     ` Markus Elfring
2024-08-29  8:14       ` Dev Jain

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=37577635-89c9-4afe-a30d-add02c0eb896@arm.com \
    --to=dev.jain@arm.com \
    --cc=Markus.Elfring@web.de \
    --cc=akpm@linux-foundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=zhujun2@cmss.chinamobile.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

all inboxes | Powered by JetHome®