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: <1341149798-12695-1-git-send-email-devendra.aaru@gmail.com>
Date:	Sun,  1 Jul 2012 19:06:38 +0530
From:	Devendra Naga <devendra.aaru@...il.com>
To:	Ian Abbott <abbotti@....co.uk>,
	Mori Hess <fmhess@...rs.sourceforge.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	H Hartley Sweeten <hsweeten@...ionengravers.com>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Cc:	Devendra Naga <devendra.aaru@...il.com>
Subject: [PATCH 1/2] staging/comedi/drivers: release allocated I/O region if alloc_private fails

if alloc_private fail, we wont' release the I/O region,
which was request_region 'ed.

release the allocated I/O region if alloc_private fails.

Signed-off-by: Devendra Naga <devendra.aaru@...il.com>
---
 drivers/staging/comedi/drivers/fl512.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/fl512.c b/drivers/staging/comedi/drivers/fl512.c
index d1da809..52e6d14 100644
--- a/drivers/staging/comedi/drivers/fl512.c
+++ b/drivers/staging/comedi/drivers/fl512.c
@@ -125,8 +125,10 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	}
 	dev->iobase = iobase;
 	dev->board_name = "fl512";
-	if (alloc_private(dev, sizeof(struct fl512_private)) < 0)
+	if (alloc_private(dev, sizeof(struct fl512_private)) < 0) {
+		release_region(iobase, FL512_SIZE);
 		return -ENOMEM;
+	}
 
 #if DEBUG
 	printk(KERN_DEBUG "malloc ok\n");
-- 
1.7.9.5

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