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:	Thu,  1 Sep 2011 23:25:15 +0530
From:	Kautuk Consul <consul.kautuk@...il.com>
To:	Russell King <linux@....linux.org.uk>
Cc:	linux-kernel@...r.kernel.org,
	Kautuk Consul <consul.kautuk@...il.com>
Subject: [PATCH 1/1] drivers/amba/bus.c: Don't perform extra matching when any one fails

If any one operation fails, then r anyways gets set to 0, which will
cause the device to not match the find_data.

Signed-off-by: Kautuk Consul <consul.kautuk@...il.com>
---
 drivers/amba/bus.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index d74926e..af2e0a1 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -699,10 +699,12 @@ static int amba_find_match(struct device *dev, void *data)
 	int r;
 
 	r = (pcdev->periphid & d->mask) == d->id;
-	if (d->parent)
-		r &= d->parent == dev->parent;
-	if (d->busid)
-		r &= strcmp(dev_name(dev), d->busid) == 0;
+	if (r) {
+		if (d->parent)
+			r &= d->parent == dev->parent;
+		if (r && d->busid)
+			r &= strcmp(dev_name(dev), d->busid) == 0;
+	}
 
 	if (r) {
 		get_device(dev);
-- 
1.7.4.1

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