+ w1-fix-w1_remove_master_device-searching.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     w1: fix w1_remove_master_device() searching
has been added to the -mm tree.  Its filename is
     w1-fix-w1_remove_master_device-searching.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: w1: fix w1_remove_master_device() searching
From: Evgeniy Polyakov <johnpol@xxxxxxxxxxx>

In case bus master driver provided bogus value as its private data, search
can be incorrect.  Problem found by Adrian Bunk.

Signed-off-by: Evgeniy Polyakov <johnpol@xxxxxxxxxxx>
Cc: Adrian Bunk <bunk@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/w1/w1_int.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -puN drivers/w1/w1_int.c~w1-fix-w1_remove_master_device-searching drivers/w1/w1_int.c
--- a/drivers/w1/w1_int.c~w1-fix-w1_remove_master_device-searching
+++ a/drivers/w1/w1_int.c
@@ -170,22 +170,24 @@ void __w1_remove_master_device(struct w1
 
 void w1_remove_master_device(struct w1_bus_master *bm)
 {
-	struct w1_master *dev = NULL;
+	struct w1_master *dev, *found = NULL;
 
 	list_for_each_entry(dev, &w1_masters, w1_master_entry) {
 		if (!dev->initialized)
 			continue;
 
-		if (dev->bus_master->data == bm->data)
+		if (dev->bus_master->data == bm->data) {
+			found = dev;
 			break;
+		}
 	}
 
-	if (!dev) {
+	if (!found) {
 		printk(KERN_ERR "Device doesn't exist.\n");
 		return;
 	}
 
-	__w1_remove_master_device(dev);
+	__w1_remove_master_device(found);
 }
 
 EXPORT_SYMBOL(w1_add_master_device);
_

Patches currently in -mm which might be from johnpol@xxxxxxxxxxx are

w1-fix-w1_remove_master_device-searching.patch
clean-up-duplicate-includes-in-drivers-w1.patch
connector-change-connectors-max-message-size.patch
uvesafb-add-connector-entries.patch
add-missing-newlines-to-some-uses-of-dev_level-messages.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux