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:   Sun,  4 Dec 2016 13:32:52 +0800
From:   Pan Bian <bianpan201603@....com>
To:     Maxim Levitsky <maximlevitsky@...il.com>
Cc:     linux-kernel@...r.kernel.org, Pan Bian <bianpan2016@....com>
Subject: [PATCH 1/1] memstick: host: fix improper return value

From: Pan Bian <bianpan2016@....com>

When pci_ioremap_bar() returns a NULL pointer, the value of return
variable "error" is 0. 0 means no error, which is contrary to the fact.
Similarly, the return values are also improper when request_irq() or
memstick_add_host() returns unexpected values. This patch fixes the bug,
assigning "-ENOMEM" to variable "error" before the call to
pci_ioremap_bar().

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188991

Signed-off-by: Pan Bian <bianpan2016@....com>
---
 drivers/memstick/host/r592.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/memstick/host/r592.c b/drivers/memstick/host/r592.c
index d5cfb50..eebed0a 100644
--- a/drivers/memstick/host/r592.c
+++ b/drivers/memstick/host/r592.c
@@ -761,6 +761,7 @@ static int r592_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (error)
 		goto error3;
 
+	error = -ENOMEM;
 	dev->mmio = pci_ioremap_bar(pdev, 0);
 	if (!dev->mmio)
 		goto error4;
-- 
1.9.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ