lists.openwall.net   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-next>] [day] [month] [year] [list]
Message-Id: <1423647406-858-1-git-send-email-kiran.padwal@smartplayin.com>
Date:	Wed, 11 Feb 2015 15:06:45 +0530
From:	Kiran Padwal <kiran.padwal@...rtplayin.com>
To:	Tomi Valkeinen <tomi.valkeinen@...com>
Cc:	Russell King <linux@....linux.org.uk>,
	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	Kiran Padwal <kiran.padwal21@...il.com>,
	Kiran Padwal <kiran.padwal@...rtplayin.com>
Subject: [PATCH] video: ARM CLCD: Add missing error check for devm_kzalloc

This patch add a missing check on the return value of devm_kzalloc,
which would cause a NULL pointer dereference in a OOM situation.

Signed-off-by: Kiran Padwal <kiran.padwal@...rtplayin.com>
---
 drivers/video/fbdev/amba-clcd.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index 32c0b6b..9362424 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -599,6 +599,9 @@ static int clcdfb_of_get_mode(struct device *dev, struct device_node *endpoint,
 
 	len = clcdfb_snprintf_mode(NULL, 0, mode);
 	name = devm_kzalloc(dev, len + 1, GFP_KERNEL);
+	if (!name)
+		return -ENOMEM;
+
 	clcdfb_snprintf_mode(name, len + 1, mode);
 	mode->name = name;
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ