Re: [PATCH] ARM: mvebu: check the validation of memory allocation

From: Russell King (Oracle)
Date: Fri Apr 29 2022 - 11:19:33 EST


On Fri, Mar 25, 2022 at 04:55:18PM +0800, xkernel.wang@xxxxxxxxxxx wrote:
> From: Xiaoke Wang <xkernel.wang@xxxxxxxxxxx>
>
> kzalloc() and kstrdup() are memory allocation functions which can return
> NULL when some internal memory errors happen. So it is better to check
> the return value of them to prevent potential wrong memory access or
> memory leak.

Are these failures silent, or will they be reported in the kernel log to
make their failure obvious to those who debug the kernel?

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!