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: <20070423145737.2d0a8ce5@the-village.bc.nu>
Date:	Mon, 23 Apr 2007 14:57:37 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	akpm@...l.org, greg@...ah.com, linux-kernel@...r.kernel.org
Subject: [PATCH] pci syscall.c: Switch to refcounting API

Signed-off-by: Alan Cox <alan@...hat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc6-mm1/drivers/pci/syscall.c linux-2.6.21-rc6-mm1/drivers/pci/syscall.c
--- linux.vanilla-2.6.21-rc6-mm1/drivers/pci/syscall.c	2007-04-12 14:14:44.000000000 +0100
+++ linux-2.6.21-rc6-mm1/drivers/pci/syscall.c	2007-04-23 11:43:53.667542736 +0100
@@ -30,7 +30,7 @@
 		goto error;
 
 	err = -ENODEV;
-	dev = pci_find_slot(bus, dfn);
+	dev = pci_get_bus_and_slot(bus, dfn);
 	if (!dev)
 		goto error;
 
@@ -67,6 +67,7 @@
 		err = put_user(dword, (unsigned int __user *)buf);
 		break;
 	};
+	pci_dev_put(dev);
 	return err;
 
 error:
@@ -84,6 +85,7 @@
 		put_user(-1, (unsigned int __user *)buf);
 		break;
 	};
+	pci_dev_put(dev);
 	return err;
 }
 
@@ -101,7 +103,7 @@
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
-	dev = pci_find_slot(bus, dfn);
+	dev = pci_get_bus_and_slot(bus, dfn);
 	if (!dev)
 		return -ENODEV;
 
@@ -139,6 +141,6 @@
 		break;
 	};
 	unlock_kernel();
-
+	pci_dev_put(dev);
 	return err;
 }
-
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