mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 10:29:37 +00:00
usb: phy: return -ENODEV on failure of try_module_get
When __usb_find_phy_dev() does not return error and try_module_get() fails, return -ENODEV. Signed-off-by: Arjun Sreedharan <arjun024@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
7d1311b93e
commit
2c4e3dbf63
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue