Re: tools/mm: Use calloc and check the potential memory allocation failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>> Replace malloc with calloc and add memory allocating check
>>                        memset(…, 0, …) call by calloc()?
>
> Calloc returns zeroed-out memory.

I propose to improve the change description considerably.


>>> 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?

Can the commit message become nicer anyhow?


…
>> * How do you think about to omit the statement “fprintf(stderr, "Out of memory\n");”?
>
> Why?

I imagine that a returned null pointer can eventually be sufficient already.
Would you get helpful background information from the variable “errno”?

Regards,
Markus





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux