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>] [day] [month] [year] [list]
Date:	Thu, 9 May 2013 10:16:56 +0800
From:	Wei Yongjun <weiyj.lk@...il.com>
To:	hjk@...sjkoch.de, gregkh@...uxfoundation.org
Cc:	yongjun_wei@...ndmicro.com.cn, linux-kernel@...r.kernel.org
Subject: [PATCH] uio: fix error return code in uio_dev_add_attributes()

From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>

Fix to return -ENOMEM in the kobject_create_and_add() and kzalloc() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
---
 drivers/uio/uio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index b645c47..c6dfc31 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -276,6 +276,7 @@ static int uio_dev_add_attributes(struct uio_device *idev)
 		mem = &idev->info->mem[mi];
 		if (mem->size == 0)
 			break;
+		ret = -ENOMEM;
 		if (!map_found) {
 			map_found = 1;
 			idev->map_dir = kobject_create_and_add("maps",
@@ -301,6 +302,7 @@ static int uio_dev_add_attributes(struct uio_device *idev)
 		port = &idev->info->port[pi];
 		if (port->size == 0)
 			break;
+		ret = -ENOMEM;
 		if (!portio_found) {
 			portio_found = 1;
 			idev->portio_dir = kobject_create_and_add("portio",

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