提交 2c4e3dbf 编写于 作者: A Arjun Sreedharan 提交者: Felipe Balbi

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: NArjun Sreedharan <arjun024@gmail.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 7d1311b9
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册