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

Russell King (Oracle) linux at armlinux.org.uk
Fri Apr 29 08:19:15 PDT 2022


On Fri, Mar 25, 2022 at 04:55:18PM +0800, xkernel.wang at foxmail.com wrote:
> From: Xiaoke Wang <xkernel.wang at foxmail.com>
> 
> 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!



More information about the linux-arm-kernel mailing list