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]
Message-ID: <201207181859.36031.hartleys@visionengravers.com>
Date:	Wed, 18 Jul 2012 18:59:35 -0700
From:	H Hartley Sweeten <hartleys@...ionengravers.com>
To:	Linux Kernel <linux-kernel@...r.kernel.org>
CC:	<devel@...verdev.osuosl.org>, <abbotti@....co.uk>,
	<gregkh@...uxfoundation.org>
Subject: [PATCH 71/90] staging: comedi: dyna_pci10xx: remove the 'start_stop_sem' mutex

The comedi core already has a mutex protecting the attach/detach
of the comedi drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@...ionengravers.com>
Cc: Ian Abbott <abbotti@....co.uk>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
 drivers/staging/comedi/drivers/dyna_pci10xx.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dyna_pci10xx.c b/drivers/staging/comedi/drivers/dyna_pci10xx.c
index bd804f1..82002c4 100644
--- a/drivers/staging/comedi/drivers/dyna_pci10xx.c
+++ b/drivers/staging/comedi/drivers/dyna_pci10xx.c
@@ -45,8 +45,6 @@
 
 #define READ_TIMEOUT 50
 
-static DEFINE_MUTEX(start_stop_sem);
-
 static const struct comedi_lrange range_pci1050_ai = { 3, {
 							  BIP_RANGE(10),
 							  BIP_RANGE(5),
@@ -267,20 +265,15 @@ static int dyna_pci10xx_attach(struct comedi_device *dev,
 	struct comedi_subdevice *s;
 	int ret;
 
-	mutex_lock(&start_stop_sem);
-
 	if (alloc_private(dev, sizeof(struct dyna_pci10xx_private)) < 0) {
 		printk(KERN_ERR "comedi: dyna_pci10xx: "
 			"failed to allocate memory!\n");
-		mutex_unlock(&start_stop_sem);
 		return -ENOMEM;
 	}
 
 	pcidev = dyna_pci10xx_find_pci_dev(dev, it);
-	if (!pcidev) {
-		mutex_unlock(&start_stop_sem);
+	if (!pcidev)
 		return -EIO;
-	}
 	devpriv->pci_dev = pcidev;
 
 	dev->board_name = thisboard->name;
@@ -289,7 +282,6 @@ static int dyna_pci10xx_attach(struct comedi_device *dev,
 	if (comedi_pci_enable(pcidev, DRV_NAME)) {
 		printk(KERN_ERR "comedi: dyna_pci10xx: "
 			"failed to enable PCI device and request regions!");
-		mutex_unlock(&start_stop_sem);
 		return -EIO;
 	}
 
@@ -306,10 +298,8 @@ static int dyna_pci10xx_attach(struct comedi_device *dev,
 	devpriv->BADR5 = pci_resource_start(pcidev, 5);
 
 	ret = comedi_alloc_subdevices(dev, 4);
-	if (ret) {
-		mutex_unlock(&start_stop_sem);
+	if (ret)
 		return ret;
-	}
 
 	/* analog input */
 	s = dev->subdevices + 0;
@@ -353,7 +343,6 @@ static int dyna_pci10xx_attach(struct comedi_device *dev,
 	s->insn_bits = dyna_pci10xx_do_insn_bits;
 
 	devpriv->valid = 1;
-	mutex_unlock(&start_stop_sem);
 
 	printk(KERN_INFO "comedi: dyna_pci10xx: %s - device setup completed!\n",
 		thisboard->name);
-- 
1.7.11

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