[3.16.y-ckt extended stable] Patch "usb: phy: return -ENODEV on failure of try_module_get" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Mon Nov 10 11:30:55 UTC 2014
This is a note to let you know that I have just added a patch titled
usb: phy: return -ENODEV on failure of try_module_get
to the linux-3.16.y-queue branch of the 3.16.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.16.y-queue
This patch is scheduled to be released in version 3.16.7-ckt1.
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.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From 774c6ae424326716eaea92d4ad58df9bf0e5a5a7 Mon Sep 17 00:00:00 2001
From: Arjun Sreedharan <arjun024 at gmail.com>
Date: Mon, 18 Aug 2014 11:17:33 +0530
Subject: usb: phy: return -ENODEV on failure of try_module_get
commit 2c4e3dbf63b39d44a291db70016c718f45d9cd46 upstream.
When __usb_find_phy_dev() does not return error and
try_module_get() fails, return -ENODEV.
Signed-off-by: Arjun Sreedharan <arjun024 at gmail.com>
Signed-off-by: Felipe Balbi <balbi at ti.com>
Cc: Mark Brown <broonie at kernel.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
drivers/usb/phy/phy.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
index 36b6bce33b20..fd0d7f122ace 100644
--- a/drivers/usb/phy/phy.c
+++ b/drivers/usb/phy/phy.c
@@ -232,6 +232,9 @@ struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
phy = __usb_find_phy_dev(dev, &phy_bind_list, index);
if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
dev_dbg(dev, "unable to find transceiver\n");
+ if (!IS_ERR(phy))
+ phy = ERR_PTR(-ENODEV);
+
goto err0;
}
--
2.1.0
More information about the kernel-team
mailing list