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: <35855327607952b24d97e7f7374a1115f400dd8c.1510806666.git.arvind.yadav.cs@gmail.com>
Date:   Thu, 16 Nov 2017 10:02:32 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     abbotti@....co.uk, hsweeten@...ionengravers.com,
        gregkh@...uxfoundation.org
Cc:     linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org
Subject: [PATCH] staging: comedi: ni_atmio: Handle return value of  pnp_*

pnp_irq() and pnp_port_start() can fail here and we must check
its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
 drivers/staging/comedi/drivers/ni_atmio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/comedi/drivers/ni_atmio.c b/drivers/staging/comedi/drivers/ni_atmio.c
index 2d62a8c..dead159 100644
--- a/drivers/staging/comedi/drivers/ni_atmio.c
+++ b/drivers/staging/comedi/drivers/ni_atmio.c
@@ -308,6 +308,9 @@ static int ni_atmio_attach(struct comedi_device *dev,
 
 		iobase = pnp_port_start(isapnp_dev, 0);
 		irq = pnp_irq(isapnp_dev, 0);
+		if (irq == -1 || !iobase)
+			return -ENOMEM;
+
 		comedi_set_hw_dev(dev, &isapnp_dev->dev);
 	}
 
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ