lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 13 Apr 2019 09:14:17 +0200
From:   Nicholas Mc Guire <>
To:     Russell King <>
Cc:     Shawn Guo <>,
        Sascha Hauer <>,
        Pengutronix Kernel Team <>,
        Fabio Estevam <>,
        NXP Linux Team <>,
        Mark Brown <>,
        Linus Walleij <>,
        Tony Lindgren <>,
        Mike Rapoport <>,
        Janusz Krzysztofik <>,,,
        Nicholas Mc Guire <>
Subject: [PATCH 1/4 RFC] ARM: imx legacy: warn on failed allocation

Even in init the allocation can fail and thus should at least warn so
that the cause can be identified.

Signed-off-by: Nicholas Mc Guire <>

Problem located with an experimental coccinelle script

Note sure if there is a better solution as this is early in the boot
process so not that could be done anyway but fuss - anyway unchecked
allocation is not a good thing.

Patch was compile-tested with: imx_v4_v5_defconfig (implies
(with some unrelated sparse warnings about unimplemented syscalls
 and a few checkpatch warnings - covered in the other patches)

Patch is against 5.1-rc4 (localversion-next is 20190412)

 arch/arm/mach-imx/mach-mx27ads.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 6dd7f57..528846f 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -247,6 +247,7 @@ static void __init mx27ads_regulator_init(void)
 	struct gpio_chip *vchip;
 	vchip = kzalloc(sizeof(*vchip), GFP_KERNEL);
+	WARN_ON(!vchip);
 	vchip->owner		= THIS_MODULE;
 	vchip->label		= "LCD";
 	vchip->base		= MX27ADS_LCD_GPIO;

Powered by blists - more mailing lists