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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1425833647-21686-1-git-send-email-mattew8898@gmail.com>
Date:	Sun,  8 Mar 2015 17:54:07 +0100
From:	Matteo Semenzato <mattew8898@...il.com>
To:	gregkh@...uxfoundation.org, lidza.louina@...il.com,
	markh@...pro.net
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	Matteo Semenzato <mattew8898@...il.com>
Subject: [PATCH] Staging: dgnc: check kzalloc result

From: Matteo Semenzato <mattew8898@...il.com>

Return -ENOMEM if allocating brd->flipbuf fails.

Signed-off-by: Matteo Semenzato <mattew8898@...il.com>
---
 drivers/staging/dgnc/dgnc_driver.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index f177d3a..711af02 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -622,6 +622,10 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	 * context, and there are no locks held.
 	 */
 	brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL);
+	if (!brd->flipbuf) {
+		kfree(brd);
+		return -ENOMEM;
+	}
 
 	wake_up_interruptible(&brd->state_wait);
 
-- 
2.3.1

--
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