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]
Date:   Mon, 31 Jul 2017 18:48:33 +0300
From:   Anton Vasilyev <vasilyev@...ras.ru>
To:     Colin Ian King <colin.king@...onical.com>
Cc:     Anton Vasilyev <vasilyev@...ras.ru>, Jiri Kosina <jkosina@...e.cz>,
        linux-kernel@...r.kernel.org, ldv-project@...uxtesting.org
Subject: [PATCH] misc: Return error on error path

If ibmasm_event_buffer_init() or ibmasm_heartbeat_init() fails,
then ibmasm_init_one() release all resources and return 0 on error path.

The patch adds corresponding error for fails.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Anton Vasilyev <vasilyev@...ras.ru>
---
 drivers/misc/ibmasm/module.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c
index c5a456b..ba76405 100644
--- a/drivers/misc/ibmasm/module.c
+++ b/drivers/misc/ibmasm/module.c
@@ -96,11 +96,13 @@ static int ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	if (ibmasm_event_buffer_init(sp)) {
 		dev_err(sp->dev, "Failed to allocate event buffer\n");
+		result = -ENOMEM;
 		goto error_eventbuffer;
 	}
 
 	if (ibmasm_heartbeat_init(sp)) {
 		dev_err(sp->dev, "Failed to allocate heartbeat command\n");
+		result = -ENOMEM;
 		goto error_heartbeat;
 	}
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ