Re: [PATCH 2/3] lkdtm/perms: Check possible NULL pointer returned by kmalloc(),vmalloc()

From: Greg KH
Date: Mon Jul 25 2022 - 08:37:16 EST


A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Mon, Jul 25, 2022 at 05:54:15PM +0800, tury wrote:
> When there is insufficient memory, the allocation will fail.

And have you ever seen that happen here? The issue is for small
allocations, they never will fail.

> the return value is void,so i think it is ok .

Why?

> should i have changed comment to something like this ?
>
> As the possible alloc failure of the kmalloc() and vmalloc(),
> the return pointer could be NULL.therefore it should be better to check it.

Please wrap your lines properly, and use '.' correctly.

thanks,

greg k-h