[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 11 Nov 2014 11:06:04 +0000
From: Luis Henriques <luis.henriques@...onical.com>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
kernel-team@...ts.ubuntu.com
Cc: Arjun Sreedharan <arjun024@...il.com>, Felipe Balbi <balbi@...com>,
Mark Brown <broonie@...nel.org>,
Luis Henriques <luis.henriques@...onical.com>
Subject: [PATCH 3.16.y-ckt 005/170] usb: phy: return -ENODEV on failure of try_module_get
3.16.7-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Arjun Sreedharan <arjun024@...il.com>
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@...il.com>
Signed-off-by: Felipe Balbi <balbi@...com>
Cc: Mark Brown <broonie@...nel.org>
Signed-off-by: Luis Henriques <luis.henriques@...onical.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
--
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