diff mbox

[3.13.y-ckt,stable] Patch "phy: Find the right match in devm_phy_destroy()" has been added to staging queue

Message ID 1428446949-1411-1-git-send-email-kamal@canonical.com
State New
Headers show

Commit Message

Kamal Mostafa April 7, 2015, 10:49 p.m. UTC
This is a note to let you know that I have just added a patch titled

    phy: Find the right match in devm_phy_destroy()

to the linux-3.13.y-queue branch of the 3.13.y-ckt extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.13.y-queue

This patch is scheduled to be released in version 3.13.11-ckt19.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

From 21dde4257fab051105b70a45485ebf27927b8a6d Mon Sep 17 00:00:00 2001
From: Thierry Reding <treding@nvidia.com>
Date: Wed, 25 Feb 2015 16:16:29 +0100
Subject: phy: Find the right match in devm_phy_destroy()

commit 2f1bce487cd0a02623cff3d877940f9a2026341c upstream.

devm_phy_create() stores the pointer to the new PHY at the address
returned by devres_alloc(). The res parameter passed to devm_phy_match()
is therefore the location where the pointer to the PHY is stored, hence
it needs to be dereferenced before comparing to the match data in order
to find the correct match.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/phy/phy-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
1.9.1
diff mbox

Patch

diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index c6683f8..e97caaa 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -50,7 +50,9 @@  static void devm_phy_consume(struct device *dev, void *res)

 static int devm_phy_match(struct device *dev, void *res, void *match_data)
 {
-	return res == match_data;
+	struct phy **phy = res;
+
+	return *phy == match_data;
 }

 static struct phy *phy_lookup(struct device *device, const char *port)